This role permits to install/configure a basic development environment.
Installs and configures :
some basic packages
some basic config files
docker, docker-compose, docker-machine
packer, vagrant, terraform
ssh config files
Get the code source :
$ git clone <REPO_URL> /local/pathSensitive data and variables are located in "vaulted" files inside the vars directory.
If you want to reuse this role, you must create your vaulted files with your own data and "vault" them with your own password.
You have to create three vaulted files inside a vars directory (not "versioned" files) :
common-vars.yml.vault: containing common variablessshconfig.yml.vault: containing SSH config variableswork-vars.yml.vault: containing work specific variables
$ ansible-vault create vars/common-vars.yml.vaultExample of common-vars.yml.vault file content :
---user:
name: miklfullName: Michael Pailloncyemail: michael.pailloncy@gmail.comhome: /home/miklcachedir: /home/mikl/.ansible-cachetools:
path: /home/mikl/toolsproxy:
host: my-work-proxy.hostnameWarning |
You need to replace all $variables by your specific values
|
By default, resetenv script will search a file named .vault-password containing your password and use it to "unvault" your data.
You need to create it inside resetenv directory :
$ echo "yourP@ssw0rd" > .vault-password$ ansible-vault create vars/sshconfig.yml.vaultExample of sshconfig.yml.vault file content :
---
sshconfig:
hosts:
host1: > Host host1 HostName hostname1 User userhost1host2: > Host host2 HostName hostname2 User userhost2...$ ansible-vault create vars/work-vars.yml.vaultExample of work-vars.yml.vault file content :
---
user:
name: miklfullName: Michael Pailloncyemail: work-email@company.frhome: /home/mikldocker_internal_registry: "my-internal-docker-registry.hostname"proxy:
host: $workProxyHostport: $workProxyPortuser: $workProxyUsernamepassword: $workProxyPasswordproxy_env:
http_proxy: 'http://{{ proxy.user }}:{{ proxy.password }}@{{ proxy.host }}:{{ proxy.port }}'https_proxy: 'http://{{ proxy.user }}:{{ proxy.password }}@{{ proxy.host }}:{{ proxy.port }}'no_proxy: '127.0.0.1,$internalDockerRegistryHostname'Warning |
You need to replace all $variables by your specific values
|
Warning | Make sure that you have read all actions made by this playbook and saved all files susceptible to be erased (zshrc, ssh config files, docker config files, etc) before run it on a non "config-managed" environment. |
$ ./resetenvTip | resetenv shell script is added in your PATH after provisioning (see zshrc template file). With a fresh new terminal, you can run it anywhere. |
Tip |
You can add any ansible-playbook options to resetenv shell script. Example: resetenv -t fast for a fast and basic reconfiguration (using fast tag).
|
After a first full provisioning has been done, the only way I’m using resetenv is to reset basic configuration files (docker, dnf, http_proxy settings) depending on my current location (work vs home).
Examples :
$ r -t fastor more often :
$ tworkThis command is an alias to do a resetenv -t fast and start tmunixator directly configured depending on my location (see templates/zshrc and templates/tmuxinator/work.yml).