Ansible

Run ansible limited to some host

With --limit you can restrict on which hosts will be executed playbook.

1
ansible-playbook ovh.yml --limit front02 --tags nginx --skip-tags apt

Also with --tags and --skip-tags parameter you can choose which tags will be applied or not.

Restart server and wait

1
2
3
4
5
6
7
8
9
10
11
- name: reboot the server
shell: sleep 2 && shutdown -r now
async: 1
poll: 0
- name: Wait for server come back
wait_for: >
host={{ inventory_hostname }}
port=22
delay=15
timeout=600
delegate_to: localhost

Tools

Comments

⬆︎TOP