Skip to content
/ utils Public

Utils project contains different tools, apps helping to survive the daily madness

License

Notifications You must be signed in to change notification settings

haf-tech/utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Utils

This utility repository contains multiple apps and tools for surviving the daily madness.

k8s-swiss

A docker image holding helpful tools like

  • Ansible

  • kubectl

  • oc

Ansible

The docker receives a mount from the local working directory to /ansible_playbooks/ this is the reason to put /ansible_playbooks/ as prefix path if you define any paths as parameters.

$ cd docker/ansible-wrapper
$ tree -a
..
├── Dockerfile
├── ansible-wrapper.sh
└── playbooks
    ├── a-playbook.yaml
    └── inventory.yaml

1 directory, 4 files
$ ./ansible-wrapper.sh -i /ansible_playbooks/playbooks/inventory.yaml /ansible_playbooks/playbooks/a-playbook.yaml

In case you test this locally (with localhost)

$ ./ansible-wrapper.sh -i /ansible_playbooks/playbooks/inventory.yaml -c local /ansible_playbooks/playbooks/a-playbook.yaml

Terraform

Using the docker image hashicorp/terraform:light and mounting the local working directory as workspace into the container. Consider to provide always the directory which holds the terraform templates for all terraform commands (init, plan, apply).

$ ./terraform-wrapper.sh init templates

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/null...
- Installing hashicorp/null v2.1.2...
- Installed hashicorp/null v2.1.2 (signed by HashiCorp)

...

$ ./terraform-wrapper.sh plan templates
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # null_resource.example will be created
  + resource "null_resource" "example" {
      + id = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.


$ ./terraform-wrapper.sh apply templates
n execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # null_resource.example will be created
  + resource "null_resource" "example" {
      + id = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

null_resource.example: Creating...
null_resource.example: Provisioning with 'local-exec'...
null_resource.example (local-exec): Executing: ["/bin/sh" "-c" "echo $(date -u +'%Y-%m-%dT%H:%M:%SZ')"]
null_resource.example (local-exec): 2020-08-29T09:05:48Z
null_resource.example: Creation complete after 0s [id=3249942302053403259]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

.

About

Utils project contains different tools, apps helping to survive the daily madness

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published