This repository has been archived on 2020-06-04. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-common/tasks/main.yml

30 lines
816 B
YAML
Raw Normal View History

- name: Create unpriviledged user
2020-05-25 19:36:49 +00:00
loop: "{{ users }}"
no_log: true
user:
2020-05-25 19:36:49 +00:00
name: "{{ item.user }}"
password: "{{ item.password | password_hash('sha512') }}"
shell: "{{ item.shell }}"
groups: "{{ item.groups }}"
append: yes
2020-04-10 14:08:12 +00:00
tags:
- users
notify:
- Disable the root account
- name: Copy ssh key for unpriviledged user
2020-05-25 19:36:49 +00:00
loop: "{{ users }}"
no_log: true
authorized_key:
2020-05-25 19:36:49 +00:00
key: "{{lookup('file', '{{ role_path }}/files/{{ item.user }}.pub')}}"
follow: yes
2020-05-25 19:36:49 +00:00
user: '{{ item.user }}'
2020-04-10 14:08:12 +00:00
tags:
- users
2020-05-25 19:36:49 +00:00
- name: Set base iptables filter # TODO: Replace this with the firewall role
copy:
src: '{{ role_path }}/files/iptables-rules/'
dest: '/etc/iptables/'
2020-05-25 19:36:49 +00:00
notify: Run service actions
2020-04-10 14:08:12 +00:00
tags:
- firewall