diff --git a/inventory/hosts.yaml b/inventory/hosts.yaml index 6c4f7f7..a894406 100644 --- a/inventory/hosts.yaml +++ b/inventory/hosts.yaml @@ -5,13 +5,25 @@ physical: ansible_become_password: "{{ ansible_become_passwd }}" ansible_connection: local ansible_python_interpreter: "{{ ansible_playbook_python }}" + services_to_run: 192.168.0.6: ansible_become_password: "{{ ansible_become_passwd }}" + services_to_run: 192.168.0.8: ansible_become_password: "{{ ansible_become_passwd }}" + services_to_run: 192.168.0.12: ansible_become_password: "{{ ansible_become_passwd }}" + services_to_run: 192.168.0.16: ansible_become_password: "{{ ansible_become_passwd }}" + services_to_run: 192.168.0.39: ansible_become_password: "{{ ansible_become_passwd }}" + services_to_run: + ai-host: + ansible_host: 192.168.0.50 + ansible_become_password: "{{ ansible_become_passwd }}" + services_to_run: + - coder_ai + diff --git a/playbooks/maintain.yaml b/playbooks/maintain.yaml index d15c438..869aac5 100644 --- a/playbooks/maintain.yaml +++ b/playbooks/maintain.yaml @@ -18,3 +18,5 @@ - ../roles/harden_ssh # Update configs - omz, nvim, ranger and so on. Distribute the last version of those configs - ../roles/update_configs + # Make sure that the services that are supposed to run are running + - ../roles/check_services diff --git a/roles/check_services/tasks/main.yaml b/roles/check_services/tasks/main.yaml new file mode 100644 index 0000000..9fc2dc8 --- /dev/null +++ b/roles/check_services/tasks/main.yaml @@ -0,0 +1,7 @@ +--- + +- name: Make sure required services are running + ansible.builtin.service: + name: "{{ item.name }}" + state: started + loop: "{{ services_to_run }}"