diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4318574 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +pass +*.swp diff --git a/ansible.cfg b/ansible.cfg index 14b7b99..3842a7b 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,3 +1,4 @@ [defaults] privatekeyfile = /home/dan/.ssh/id_rsa.pub inventory = inventory +become_password_file = pass diff --git a/notes b/notes new file mode 100644 index 0000000..f197883 --- /dev/null +++ b/notes @@ -0,0 +1,4 @@ +- Ask ssh password: -k +- pass usename: -u +- Pass different Inventory file: -i + diff --git a/ping.yml b/ping.yml new file mode 100644 index 0000000..f29dd2e --- /dev/null +++ b/ping.yml @@ -0,0 +1,18 @@ +--- + +- hosts: localhost + connection: local + gather_facts: false + + tasks: + - name: create temp group + add_host: + name: '192.168.86.10' + groups: restart + +- hosts: restart + tasks: + - name: restart + ping: + + diff --git a/restart.yml b/restart.yml new file mode 100644 index 0000000..fea69bf --- /dev/null +++ b/restart.yml @@ -0,0 +1,19 @@ +--- + +- hosts: localhost + connection: local + gather_facts: false + + tasks: + - name: create temp group + add_host: + name: '192.168.86.10' + groups: restart + +- hosts: restart + tasks: + - name: restart + become: true + reboot: + +