Skip to content

Latest commit

 

History

History
47 lines (39 loc) · 1.03 KB

README.md

File metadata and controls

47 lines (39 loc) · 1.03 KB

Roles for my testing stand...

URLs:

Install Ansible:

python3 -m venv --upgrade-deps env && \
./env/bin/pip3 install -r requirements.txt

Get example config:

./env/bin/ansible-config init --disabled > ansible.cfg.example

Get VM info:

./env/bin/ansible -i <inventory> -m 'gather_facts' <hosts> > facts.json

Ping host:

./env/bin/ansible -i <inventory> -m 'ping' <hosts>

New empty role:

./env/bin/ansible-galaxy role init <role>
mkdir -p "${ROLE}"/{tasks,vars} && \
touch "${ROLE}"/{tasks,vars}/main.yml && \
touch "${ROLE}"/README.md

Run Playbook:

./env/bin/ansible-playbook -i <inventory> -t <tags> -e <extra-vars> -l <hosts-limit> <playbook>

Test Playbook:

./env/bin/ansible-playbook -i <inventory> -C <playbook>