added next folders for migration

This commit is contained in:
2026-03-10 08:54:22 +01:00
parent 4321b92003
commit 3b69def1b8
7 changed files with 211 additions and 0 deletions

51
inventory/inventory.yml Normal file
View File

@@ -0,0 +1,51 @@
for_installation:
hosts:
new_hosts:
ansible_host: 192.168.0.68
become_method: sudo
become_user: testuser
vars:
ansible_host_key_checking: false
ansible_user: testuser
ansible_password: a123456
become_method: sudo
become_user: testuser
ansible_become_password: a123456
ha:
hosts:
homeassistant:
ansible_host: 192.168.0.57
caddy:
ansible_host: 192.168.0.68
vars:
ansible_host_key_checking: false
ansible_user: mario
ansible_password: migO0472
nc:
hosts:
nextcloud:
ansible_host: 192.168.0.70
vars:
ansible_host_key_checking: false
ansible_user: mario
ansible_password: migO0472
proxy:
hosts:
caddy:
ansible_host: 192.168.0.59
vars:
ansible_host_key_checking: false
ansible_user: mario
ansible_password: migO0472
prod:
hosts:
homeassistant:
ansible_host: 192.168.0.57
nextcloud:
ansible_host: 192.168.0.70
caddy:
ansible_host: 192.168.0.59
vars:
ansible_host_key_checking: false
ansible_user: mario
ansible_password: migO0472

View File

@@ -0,0 +1,16 @@
- name: Install the caddy docker release
hosts: new_hosts
tasks:
- name: call the caddy install role
ansible.builtin.include_role:
name: install_caddy_docker
tasks_from: create_folder_structure.yml
- name: install_caddy_docker
ansible.builtin.include_role:
name: install_caddy_docker
tasks_from: copy_files.yml
- name: call the caddy start role
ansible.builtin.include_role:
name: install_caddy_docker
tasks_from: start_docker_container.yml

View File

@@ -0,0 +1,63 @@
- name: Install the homeassistant docker with additional features as choosen
hosts: new_hosts
gather_facts: True
tasks:
# - name: call the homeassistant stop role
# ansible.builtin.include_role:
# name: install_homeassistant_docker
# tasks_from: stop_docker_container.yml
- name: call the install docker role
ansible.builtin.include_role:
name: create_folder_structure
tasks_from: create_ha_folder_structure.yml
when: "{{ ha}}"
- name: copy the ha docker files
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: copy_ha_files.yml
when: "{{ ha }}"
- name: copy the postgres docker files
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: copy_postgres_files.yml
when: "{{ pg }}"
- name: copy the mosquitto docker files
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: copy_mosquitto_files.yml
when: "{{ mq }}"
# - name: install homeassistant docker with grafana
# ansible.builtin.include_role:
# name: install_homeassistant_docker
# tasks_from: copy_files_ha-grafana.yml
# when: "{{ grafana }}"
# - name: install homeassistant docker (HA + PostgresDB)
# ansible.builtin.include_role:
# name: install homeassistant docker only
# tasks_from: copy_files_ha-only.yml
# when: "{{ ha-only }}"
- name: call the homeassistant ha start role
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: start_ha_docker_container.yml
when: "{{ ha }}"
- name: call the homeassistant postgres start role
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: start_postgres_docker_container.yml
when: "{{ pg }}"
- name: call the homeassistant mosquitto start role
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: start_mosquitto_docker_container.yml
when: "{{ mq }}"

View File

@@ -0,0 +1,31 @@
- name: Install the homeassistant docker with additional features as choosen
hosts: new_hosts
gather_facts: True
tasks:
- name: call the homeassistant stop role
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: stop_docker_container.yml
- name: call the install docker role
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: create_folder_structure.yml
- name: install homeassistant docker with grafana
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: copy_files_ha-grafana.yml
when: "{{ grafana }}"
- name: install homeassistant docker (HA + PostgresDB)
ansible.builtin.include_role:
name: install homeassistant docker only
tasks_from: copy_files_ha-only.yml
when: "{{ ha-only }}"
- name: call the homeassistant start role
ansible.builtin.include_role:
name: install_homeassistant_docker
tasks_from: start_docker_container.yml

16
playbooks/pi_uname.yml Normal file
View File

@@ -0,0 +1,16 @@
- name: execute uname on the inventory hosts as demo
hosts: nextcloud
tasks:
- name: create file to write in
become: false
command: touch output.txt
- name: get system informations
become: true
shell: apt update
register: os_info
- debug:
msg: "{{os_info.stdout_lines}}"
#when: inventory_hostname in groups['proxy']

33
playbooks/pi_upgrade.yml Normal file
View File

@@ -0,0 +1,33 @@
- name: Update the Pi OS
hosts: nextcloud
tasks:
- name: call the update role
ansible.builtin.include_role:
name: upgrade_os
tasks_from: pi_update.yml
- name: call the upgrade role
ansible.builtin.include_role:
name: upgrade_os
tasks_from: pi_upgrade.yml
- name: call the restart role
ansible.builtin.include_role:
name: upgrade_os
tasks_from: pi_restart.yml
# tasks:
# - name: create file to write in
# become: false
# command: touch output.txt
#
# - name: get system informations
# become: true
# shell: apt update
# register: os_info
#
# - debug:
# msg: "{{os_info.stdout_lines}}"
#when: inventory_hostname in groups['proxy']

1
playbooks/roles Symbolic link
View File

@@ -0,0 +1 @@
../roles/