Slowing building out the new workflows
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 5s
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 5s
This commit is contained in:
0
playbooks/static/files/.gitkeep
Normal file
0
playbooks/static/files/.gitkeep
Normal file
0
playbooks/static/handlers/.gitkeep
Normal file
0
playbooks/static/handlers/.gitkeep
Normal file
5
playbooks/static/handlers/main.yaml
Normal file
5
playbooks/static/handlers/main.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
- name: Restart SSH
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: sshd
|
||||
state: restarted
|
||||
0
playbooks/static/tasks/.gitkeep
Normal file
0
playbooks/static/tasks/.gitkeep
Normal file
43
playbooks/static/tasks/setup-webadmin.yaml
Normal file
43
playbooks/static/tasks/setup-webadmin.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
- name: Ensure sudo is available
|
||||
ansible.builtin.apt:
|
||||
state: present
|
||||
update_cache: true
|
||||
pkg:
|
||||
- sudo
|
||||
- zsh
|
||||
- name: Create webadmin user
|
||||
ansible.builtin.user:
|
||||
name: webadmin
|
||||
state: present
|
||||
shell: /bin/zsh
|
||||
groups:
|
||||
- nginx
|
||||
append: true
|
||||
- name: Copy webadmin public key
|
||||
ansible.posix.authorized_key:
|
||||
user: webadmin
|
||||
state: present
|
||||
key: "{{ lookup('file', 'files/webadmin.pem.pub') }}"
|
||||
- name: Add webadmin to sudoers
|
||||
ansible.builtin.copy:
|
||||
dest: "/etc/sudoers.d/webadmin"
|
||||
content: "webadmin ALL=(ALL) NOPASSWD: ALL"
|
||||
mode: "0644"
|
||||
owner: root
|
||||
group: root
|
||||
- name: Disable Password Authentication
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
line: PasswordAuthentication no
|
||||
state: present
|
||||
backup: true
|
||||
notify:
|
||||
- Restart SSH
|
||||
- name: Disable root login
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
line: PermitRootLogin no
|
||||
state: present
|
||||
backup: true
|
||||
notify:
|
||||
- Restart SSH
|
||||
0
playbooks/static/templates/.gitkeep
Normal file
0
playbooks/static/templates/.gitkeep
Normal file
0
playbooks/static/vars/.gitkeep
Normal file
0
playbooks/static/vars/.gitkeep
Normal file
Reference in New Issue
Block a user