ansible-role-system/tasks/main.yml
Denis Knauf 3beb52ad22 init
2021-04-10 22:11:19 +02:00

67 lines
1.2 KiB
YAML

---
# vim: set expandtab tabstop=2 shiftwidth=2:
- name: directories
file:
state: directory
path: '{{item}}'
with_items:
- /etc/vim
#- /etc/syslog-ng
- /etc/sudoers.d
- name: configs
copy:
src: "{{item.key}}"
dest: "{{item.value}}"
owner: root
group: root
mode: 0644
backup: yes
with_dict:
vimrc.local: /etc/vim/vimrc.local
rsyslog.conf: /etc/rsyslog.conf
- name: 'configs (templates)'
template:
src: "{{item.key}}"
dest: "{{item.value}}"
owner: root
group: root
mode: 0644
backup: yes
with_dict:
tmux.conf.j2: /etc/tmux.conf
krb5.conf.j2: /etc/krb5.conf
- name: sudoers defaults
copy:
src: defaults.sudoers
dest: /etc/sudoers.d/defaults
owner: root
group: root
mode: 0440
- name: timer-mail
copy:
src: timer-mail
dest: /usr/local/bin/timer-mail
owner: root
group: root
mode: 0755
- include_tasks: 'os-{{ansible_facts["os_family"]|lower}}.yml'
- name: motd
copy:
content: '{{motd}}'
dest: /etc/motd
mode: 0644
owner: root
group: root
- name: post etckeeper commit
shell: |
set -e
dd if=/dev/urandom of=/etc/.etckeeper_random count=1
etckeeper commit 'post ansible sys'