diff --git a/ex-inv_deploy-host.yml b/example-host-inventory-file.yml similarity index 100% rename from ex-inv_deploy-host.yml rename to example-host-inventory-file.yml diff --git a/setup-host.yml b/setup-host.yml deleted file mode 100644 index 9a9f293..0000000 --- a/setup-host.yml +++ /dev/null @@ -1,102 +0,0 @@ ---- -########################################################################### -# -# This is a playbook to deploy a default configurations to a LAN host. -# -########################################################################### -# -# This playbook depends on the 'host_config' list variable in an inventory -# definition file -# -######################################## -# -# This playbook can be run using the following command line; -# -# ansible-playbook -i setup_host.yml -# -# ie, -# ansible-playbook -i 192.168.1.123, setup_host.yml -# or -# ansible-playbook -l (host) -i inventory/prod.yml setup_host.yml -# -########################################################################### - -- hosts: all - gather_facts: true - user: root - - vars: - username: "{{ hostvars[inventory_hostname].user }}" - sudoers_user: "{{ hostvars[inventory_hostname].user }}" - userpw: "{{ hostvars[inventory_hostname].pw }}" - homedir: "{{ hostvars[inventory_hostname].home }}" - host_config: "{{ hostvars[inventory_hostname].host_config }}" - guest_ip: "{{ hostvars[inventory_hostname].ansible_host }}" - - pre_tasks: - - - name: - debug: - msg: "setup-host.yml playbook" - - roles: - - ####################################################### - # roles applied to all guests - - role: update_cache - - role: upgrade_pkgs - - role: pfetch - - ####################################################### - - role: base_pkgs - when: '"base_pkgs" in host_config' - - ####################################################### - - role: create_user - when: '"create_user" in host_config' - - role: sudoers - when: '"create_user" in host_config' - - role: vim_setup - when: '"create_user" in host_config' - - role: bash_mods - when: '"create_user" in host_config' - - role: gitconfig - when: '"create_user" in host_config' - - ####################################################### - - role: du_backups - when: '"du_backups" in host_config' - - ####################################################### - - role: monitorix - vars: - # set variable to same value as in monitorix.yml playbook - monitorix_pkg: "monitorix_3.15.0-izzy1_all.deb" - when: '"monitorix" in host_config' - - ####################################################### - - role: nagios_agent - vars: - agent_ip: "{{ guest_ip }}" - when: '"nagios_agent" in host_config' - - ####################################################### - - role: docker - vars: - # set variable to same value as in docker.yml playbook - docker_compose_version: "v2.14.2" - when: '"docker" in host_config' - - ####################################################### - - role: k3s - vars: - # Calculate the number of target hosts - numhosts: "{{ ansible_play_hosts | length }}" - # first inventory host will be master node - master_host: "{{ ansible_play_hosts[0] }}" - master_ip: "{{ hostvars[master_host].ansible_host }}" - # change k3s_user to create a non-root admin user - k3s_user: root - when: '"k3s" in host_config' - -# EOF