commit b853c3bc1ff1409cc535ac97b9101967bb733e12 Author: saul365 Date: Mon Mar 25 21:30:33 2024 -0600 Add general hosts and fist playbook diff --git a/hosts.ini b/hosts.ini new file mode 100644 index 0000000..ee28476 --- /dev/null +++ b/hosts.ini @@ -0,0 +1,6 @@ +[linode] +proxy ansible_host=45.79.210.141 ansible_user=root +[homelab] +k3s-main ansible_host=nextia.cloud ansible_user=root +playground ansible_host=ahuicalli.nextia.cloud ansible_user=root +laptop ansible_host=katze.nextia.cloud ansible_user=root diff --git a/playbook.yaml b/playbook.yaml new file mode 100644 index 0000000..ace57f0 --- /dev/null +++ b/playbook.yaml @@ -0,0 +1,9 @@ +- name: My first play + hosts: all + tasks: + - name: Ping my hosts + ansible.builtin.ping: + + - name: Print message + ansible.builtin.debug: + msg: Hello world diff --git a/update-ip.yaml b/update-ip.yaml new file mode 100644 index 0000000..47f634f --- /dev/null +++ b/update-ip.yaml @@ -0,0 +1,15 @@ +- name: Update proxy IP + hosts: proxy + vars: + proxy_conf_path: "/etc/nginx/nginx.conf" + old_ip6: "sbhbad" + new_ip6: "sbhgood" + tasks: + - name: Change ip in + ansible.builtin.shell: sed -i s/{{ old_ip6 }}/{{ new_ip6 }}/ {{ proxy_conf_path }} + + - name: Restart nginx service + ansible.builtin.service: + name: nginx + state: restarted +