Ansiblers: label your shit

$ tree
.
├── group_vars
│ └── web.yml
├── host_vars
│ └── web1.yml
├── hosts.py
├── playbooks
│ └── webservers.yml
└── roles
├── base
│ ├── defaults
│ │ └── main.yml
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── tasks
│ │ └── main.yml
│ └── vars
│ └── main.yml
├── requirements.yml
└── webserver
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ ├── config_properties.yml
│ ├── install_nginx.yml
│ └── main.yml
└── vars
├── main.yml
└── properties.yml
- name: Load variables describing config properties
include_vars:
file: "{{ _var_d }}/properties.yml"
... or even ...- include_vars:
file: "{{ _var_d }}/properties.yml"
- name: config_properties | Load variables describing config properties
include_vars:
file: "{{ _var_d }}/properties.yml"
... let's run ansible-playbook ...TASK [webserver : config_properties | Load variables describing config properties]
...
# playbooks/webservers.yml
---
- hosts: webservers
roles:
- webserver
... let's run ansible-playbook ...PLAY [localhost] ***************************************************
- name: playbooks | webservers | run webservers role on webservers
hosts: webservers
roles:
- webserver
.... let's run ansible-playbook ...PLAY [playbooks | webservers | run webservers role on webservers] **
install_path: "/opt/my-webserver"
port: 3000
nginx_install_path: "/opt/nginx"
nginx_port: 3000

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store