diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-01-06 18:31:09 +0000 |
---|---|---|
committer | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-01-06 18:31:09 +0000 |
commit | a2f60b8691706d67c1b5446a78f8bebd541f554c (patch) | |
tree | 1ad6835d702d361805f2c04ff5a2babbb0c71076 /roles/essential/tasks | |
parent | db46530e3349439f4417efab5af7b38e1ad928d1 (diff) | |
download | infra-a2f60b8691706d67c1b5446a78f8bebd541f554c.tar.gz infra-a2f60b8691706d67c1b5446a78f8bebd541f554c.tar.bz2 infra-a2f60b8691706d67c1b5446a78f8bebd541f554c.zip |
Migrate essential role to playbook completely
Diffstat (limited to 'roles/essential/tasks')
-rw-r--r-- | roles/essential/tasks/atop.yml | 38 | ||||
-rw-r--r-- | roles/essential/tasks/main.yml | 4 | ||||
-rw-r--r-- | roles/essential/tasks/sudo.yml | 31 | ||||
-rw-r--r-- | roles/essential/tasks/users.yml | 29 |
4 files changed, 0 insertions, 102 deletions
diff --git a/roles/essential/tasks/atop.yml b/roles/essential/tasks/atop.yml deleted file mode 100644 index 7617f68..0000000 --- a/roles/essential/tasks/atop.yml +++ /dev/null @@ -1,38 +0,0 @@ -- name: Install atop - ansible.builtin.package: - name: - - atop - state: present - -- name: Setup per-minute atop snapshot - ansible.builtin.lineinfile: - dest: /etc/default/atop - state: present - regexp: '^#?LOGINTERVAL=' - line: 'LOGINTERVAL=60' - owner: root - group: root - mode: u+rw,g+r,o+r - notify: - - Restart atop - -- name: Setup logrotate to save 7 days of logs for atop - ansible.builtin.lineinfile: - dest: /etc/default/atop - state: present - regexp: '^#?LOGGENERATIONS=' - line: 'LOGGENERATIONS=7' - owner: root - group: root - mode: u+rw,g+r,o+r - notify: - - Restart atop - -- name: Enable atop systemd service and logrotate timer - ansible.builtin.service: - name: '{{ item }}' - enabled: yes - state: started - loop: - - atop - - atop-rotate.timer diff --git a/roles/essential/tasks/main.yml b/roles/essential/tasks/main.yml deleted file mode 100644 index fbcf875..0000000 --- a/roles/essential/tasks/main.yml +++ /dev/null @@ -1,4 +0,0 @@ -- ansible.builtin.import_tasks: roles/essential/tasks/packages.yml -- ansible.builtin.import_tasks: roles/essential/tasks/users.yml -- ansible.builtin.import_tasks: roles/essential/tasks/sudo.yml -- ansible.builtin.import_tasks: roles/essential/tasks/atop.yml diff --git a/roles/essential/tasks/sudo.yml b/roles/essential/tasks/sudo.yml deleted file mode 100644 index e2d4861..0000000 --- a/roles/essential/tasks/sudo.yml +++ /dev/null @@ -1,31 +0,0 @@ -- name: Install sudo - ansible.builtin.package: - name: - - sudo - state: present - -- name: Allow wheel group to use sudo - ansible.builtin.lineinfile: - dest: /etc/sudoers - state: present - regexp: '^(# )?%wheel ALL=\(ALL:ALL\) NOPASSWD: ALL' - line: '%wheel ALL=(ALL:ALL) NOPASSWD: ALL' - validate: "visudo -cf %s" - owner: root - group: root - mode: u+r,g+r,o-rwx - -- name: Use hard-coded PATH instead of the user's to find commands - ansible.builtin.lineinfile: - dest: /etc/sudoers - state: present - # Double quotes are important here if we want to break the line on multiple - # lines, as escaping doesn't work with single quotes. - regexp: "^(# )?Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:\ - /usr/sbin:/usr/bin:/sbin:/bin\"" - line: "Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:\ - /usr/sbin:/usr/bin:/sbin:/bin\"" - validate: "visudo -cf %s" - owner: root - group: root - mode: u+r,g+r,o-rwx diff --git a/roles/essential/tasks/users.yml b/roles/essential/tasks/users.yml deleted file mode 100644 index 4749c44..0000000 --- a/roles/essential/tasks/users.yml +++ /dev/null @@ -1,29 +0,0 @@ -- name: Remove default users - ansible.builtin.user: - name: '{{ item }}' - state: absent - loop: - - arch - -- name: Create user for Dmitry Ilvokhin - ansible.builtin.user: - name: d - home: /home/d - groups: - - wheel - -- name: Setup SSH directory for Dmitry Ilvokhin - ansible.builtin.file: - path: /home/d/.ssh - state: directory - owner: d - group: d - mode: u+rw,g-wx,o-rwx - -- name: Update authorized_keys for Dmitry Ilvokhin - ansible.builtin.copy: - src: roles/essential/files/id_rsa.pub - dest: /home/d/.ssh/authorized_keys - owner: d - group: d - mode: u+rw,g-rwx,o-rwx |