From 8d061c92d800930cacdec55d39224a70db02fa6f Mon Sep 17 00:00:00 2001 From: rubenb Date: Wed, 11 Oct 2023 13:45:13 +0200 Subject: [PATCH] base config files --- linux/base-config-debian/add-repos-vn.yaml | 12 ++++ .../base-config-debian-os.yaml | 12 ++++ .../base-config-debian.yaml | 60 +++++++++++++++++++ .../base-config-debian/configure-bashrc.yaml | 12 ++++ .../configure-usrmerge.yaml | 12 ++++ .../create-awx-user-and-config.yaml | 12 ++++ .../hardnening-config-root-user.yaml | 15 +++++ .../tasks/main.yaml | 22 +++++++ .../create-awx-user-and-config/vars/main.yaml | 2 + linux/base-config-debian/server-type.yaml | 12 ++++ linux/base-config-debian/vim-options.yaml | 12 ++++ 11 files changed, 183 insertions(+) create mode 100644 linux/base-config-debian/add-repos-vn.yaml create mode 100644 linux/base-config-debian/base-config-debian-os.yaml create mode 100644 linux/base-config-debian/base-config-debian.yaml create mode 100644 linux/base-config-debian/configure-bashrc.yaml create mode 100644 linux/base-config-debian/configure-usrmerge.yaml create mode 100644 linux/base-config-debian/create-awx-user-and-config.yaml create mode 100644 linux/base-config-debian/hardnening-config-root-user.yaml create mode 100644 linux/base-config-debian/roles/create-awx-user-and-config/tasks/main.yaml create mode 100644 linux/base-config-debian/roles/create-awx-user-and-config/vars/main.yaml create mode 100644 linux/base-config-debian/server-type.yaml create mode 100644 linux/base-config-debian/vim-options.yaml diff --git a/linux/base-config-debian/add-repos-vn.yaml b/linux/base-config-debian/add-repos-vn.yaml new file mode 100644 index 0000000..1a1608d --- /dev/null +++ b/linux/base-config-debian/add-repos-vn.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + - name: "example" + + handlers: + - include_tasks: roles/add-repos-vn/handlers/main.yaml \ No newline at end of file diff --git a/linux/base-config-debian/base-config-debian-os.yaml b/linux/base-config-debian/base-config-debian-os.yaml new file mode 100644 index 0000000..49b9b03 --- /dev/null +++ b/linux/base-config-debian/base-config-debian-os.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + - name: "example" + + handlers: + - include_tasks: roles/base-config-debian-os/handlers/main.yaml \ No newline at end of file diff --git a/linux/base-config-debian/base-config-debian.yaml b/linux/base-config-debian/base-config-debian.yaml new file mode 100644 index 0000000..90b931c --- /dev/null +++ b/linux/base-config-debian/base-config-debian.yaml @@ -0,0 +1,60 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: yes + + tasks: + + - name: "[CREATE AWX-USER] Create awx user and config ssh-key" + import_role: + name: create-awx-user-and-config + tags: awx-user_config + + - name: "[HARDNENING] Configure SSH root user" + import_role: + name: hardnening-config-root-user + tags: hardnening-config-root_config + + - name: "[BASE CONFIG] Configure debian os" + import_role: + name: base-config-debian-os + tags: base-os_config + + - name: "[GUEST SIDE] Install guest side" + import_role: + name: server-type + tags: server-type_config + + - name: "[CONFIG REPOS] Add-repos-vn" + import_role: + name: add-repos-vn + tags: add-repos-vn_config + + - name: "[CONFIG VIM] Configure vim options" + import_role: + name: vim-options + tags: vim-options_config + + - name: "[CONFIG BASHRC] Configure bashrc" + import_role: + name: configure-bashrc + tags: configure-bashrc_config + + - name: "[CONFIG USRMERGE] Configure usrmerge" + import_role: + name: configure-usrmerge + tags: configure-usrmerge_config + +handlers: + - include_tasks: roles/{{ item }}/handlers/main.yaml + with_items: + - create-awx-user-and-config + - hardnening-config-root-user + - base-config-debian-os + - server-type + - add-repos-vn + - vim-options + - configure-bashrc + - configure-usrmerge \ No newline at end of file diff --git a/linux/base-config-debian/configure-bashrc.yaml b/linux/base-config-debian/configure-bashrc.yaml new file mode 100644 index 0000000..d1378d9 --- /dev/null +++ b/linux/base-config-debian/configure-bashrc.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + - name: "example" + + handlers: + - include_tasks: roles/configure-bashrc/handlers/main.yaml \ No newline at end of file diff --git a/linux/base-config-debian/configure-usrmerge.yaml b/linux/base-config-debian/configure-usrmerge.yaml new file mode 100644 index 0000000..15da293 --- /dev/null +++ b/linux/base-config-debian/configure-usrmerge.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + - name: "example" + + handlers: + - include_tasks: roles/configure-usrmerge/handlers/main.yaml \ No newline at end of file diff --git a/linux/base-config-debian/create-awx-user-and-config.yaml b/linux/base-config-debian/create-awx-user-and-config.yaml new file mode 100644 index 0000000..7791b7b --- /dev/null +++ b/linux/base-config-debian/create-awx-user-and-config.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + + - name: "[CREATE AWX-USER] Create awx user and config ssh-key" + import_role: + name: create-awx-user-and-config \ No newline at end of file diff --git a/linux/base-config-debian/hardnening-config-root-user.yaml b/linux/base-config-debian/hardnening-config-root-user.yaml new file mode 100644 index 0000000..afce1a0 --- /dev/null +++ b/linux/base-config-debian/hardnening-config-root-user.yaml @@ -0,0 +1,15 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + + - name: "[HARDNENING] Configure SSH root user" + import_role: + name: hardnening-config-root-user + +# handlers: +# - include_tasks: roles/hardnening-config-root-user/handlers/main.yaml \ No newline at end of file diff --git a/linux/base-config-debian/roles/create-awx-user-and-config/tasks/main.yaml b/linux/base-config-debian/roles/create-awx-user-and-config/tasks/main.yaml new file mode 100644 index 0000000..9146e6e --- /dev/null +++ b/linux/base-config-debian/roles/create-awx-user-and-config/tasks/main.yaml @@ -0,0 +1,22 @@ +--- + +# vars files + vars_files: + +# create user awx-user on debian os +- name: Create a ssh user awx-user in the system + user: + name: awx-user + password: '*' + shell: /bin/bash + groups: sudo + state: present + comment: ssh user + +# add ssh-key pub to user awx-user +- name: Adding ssh-pub-key to user awx-user + authorized_key: + user: awx-user + key: "{{ key_to_add }}" + +# add awx-user to sudoers diff --git a/linux/base-config-debian/roles/create-awx-user-and-config/vars/main.yaml b/linux/base-config-debian/roles/create-awx-user-and-config/vars/main.yaml new file mode 100644 index 0000000..89acff0 --- /dev/null +++ b/linux/base-config-debian/roles/create-awx-user-and-config/vars/main.yaml @@ -0,0 +1,2 @@ +# variables +key_to_add: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHnD4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJsOoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2Vo05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGTSHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es \ No newline at end of file diff --git a/linux/base-config-debian/server-type.yaml b/linux/base-config-debian/server-type.yaml new file mode 100644 index 0000000..5a86fe8 --- /dev/null +++ b/linux/base-config-debian/server-type.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + - name: "example" + + handlers: + - include_tasks: roles/server-type/handlers/main.yaml \ No newline at end of file diff --git a/linux/base-config-debian/vim-options.yaml b/linux/base-config-debian/vim-options.yaml new file mode 100644 index 0000000..617be03 --- /dev/null +++ b/linux/base-config-debian/vim-options.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: "{{ ip_addr }}" + become: yes + become_method: sudo + gather_facts: no + + tasks: + - name: "example" + + handlers: + - include_tasks: roles/vim-options/handlers/main.yaml \ No newline at end of file