diff --git a/ansible.cfg b/ansible.cfg index fa6cc7e..8c1335f 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,2 +1,2 @@ [defaults] -inventory = inventory/servers.ini +inventory = inventory/hosts.yml diff --git a/base.yml b/base.yml index 512ebcf..d6660bc 100644 --- a/base.yml +++ b/base.yml @@ -8,14 +8,13 @@ #=================================================================================================== --- -- hosts: ubuntu - remote_user: ansible - become: true +- hosts: datacenter + remote_user: root roles: - - base + - setup # Clean up the system -- hosts: ubuntu +- hosts: datacenter remote_user: ansible become: true tasks: diff --git a/inventory/hosts.yml b/inventory/hosts.yml new file mode 100644 index 0000000..34a8c77 --- /dev/null +++ b/inventory/hosts.yml @@ -0,0 +1,41 @@ +# =================================================================================================== +# ? ABOUT +# @author : Noah Knegt +# @email : personal@noahknegt.com +# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations +# @createdOn : 27-03-2023 +# @description : This file contains the hosts for ansible. +# =================================================================================================== + +--- +vpses: + hosts: + vps1-contabo: + ansible_host: 161.97.139.67 + ansible_port: 4422 + +pis: + hosts: + pi1: + ansible_host: 192.168.90.2 + pi2: + ansible_host: 192.168.90.3 + +equinox-servers: + hosts: + apollo: + ansible_host: 23.97.157.206 + ansible_port: 2004 + +all: + children: + home: + children: + pis: + datacenter: + children: + vpses: + equinox: + children: + equinox-servers: + diff --git a/inventory/servers.ini b/inventory/servers.ini deleted file mode 100644 index ae12b02..0000000 --- a/inventory/servers.ini +++ /dev/null @@ -1,6 +0,0 @@ -[private] -vps1 ansible_host=vps.noahknegt.com:4422 -rpi1 ansible_host=192.168.90.2 - -[equinox] -apollo ansible_host=apollo.svequinox.nl:2004 diff --git a/roles/base/files/ansible/ansible.pub b/roles/setup/files/ansible/ansible.pub similarity index 100% rename from roles/base/files/ansible/ansible.pub rename to roles/setup/files/ansible/ansible.pub diff --git a/roles/base/files/ansible/ansible_sudoers b/roles/setup/files/ansible/ansible_sudoers similarity index 100% rename from roles/base/files/ansible/ansible_sudoers rename to roles/setup/files/ansible/ansible_sudoers diff --git a/roles/base/files/noahk/noahk.pub b/roles/setup/files/noahk/noahk.pub similarity index 100% rename from roles/base/files/noahk/noahk.pub rename to roles/setup/files/noahk/noahk.pub diff --git a/roles/base/files/noahk/noahk_sudoers b/roles/setup/files/noahk/noahk_sudoers similarity index 100% rename from roles/base/files/noahk/noahk_sudoers rename to roles/setup/files/noahk/noahk_sudoers diff --git a/roles/base/files/ssh_banner.net b/roles/setup/files/ssh_banner.net similarity index 100% rename from roles/base/files/ssh_banner.net rename to roles/setup/files/ssh_banner.net diff --git a/roles/base/handlers/main.yml b/roles/setup/handlers/main.yml similarity index 100% rename from roles/base/handlers/main.yml rename to roles/setup/handlers/main.yml diff --git a/roles/base/tasks/main.yml b/roles/setup/tasks/main.yml similarity index 100% rename from roles/base/tasks/main.yml rename to roles/setup/tasks/main.yml diff --git a/roles/base/tasks/software/repositories.yml b/roles/setup/tasks/software/repositories.yml similarity index 100% rename from roles/base/tasks/software/repositories.yml rename to roles/setup/tasks/software/repositories.yml diff --git a/roles/base/tasks/system/openssh.yml b/roles/setup/tasks/system/openssh.yml similarity index 100% rename from roles/base/tasks/system/openssh.yml rename to roles/setup/tasks/system/openssh.yml diff --git a/roles/base/tasks/users/ansible.yml b/roles/setup/tasks/users/ansible.yml similarity index 100% rename from roles/base/tasks/users/ansible.yml rename to roles/setup/tasks/users/ansible.yml diff --git a/roles/base/tasks/users/noahk.yml b/roles/setup/tasks/users/noahk.yml similarity index 100% rename from roles/base/tasks/users/noahk.yml rename to roles/setup/tasks/users/noahk.yml diff --git a/roles/base/templates/sshd_config.j2 b/roles/setup/templates/sshd_config.j2 similarity index 100% rename from roles/base/templates/sshd_config.j2 rename to roles/setup/templates/sshd_config.j2 diff --git a/roles/base/vars/Archlinux.yml b/roles/setup/vars/Archlinux.yml similarity index 100% rename from roles/base/vars/Archlinux.yml rename to roles/setup/vars/Archlinux.yml diff --git a/roles/base/vars/Debian.yml b/roles/setup/vars/Debian.yml similarity index 100% rename from roles/base/vars/Debian.yml rename to roles/setup/vars/Debian.yml diff --git a/roles/base/vars/Ubuntu.yml b/roles/setup/vars/Ubuntu.yml similarity index 100% rename from roles/base/vars/Ubuntu.yml rename to roles/setup/vars/Ubuntu.yml diff --git a/roles/base/vars/main.yml b/roles/setup/vars/main.yml similarity index 100% rename from roles/base/vars/main.yml rename to roles/setup/vars/main.yml