Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible: Use systematically the systemd module #67

Merged
merged 4 commits into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions ansible/tasks/dns/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,15 @@
server:
qname-minimisation: yes

- name: enable unbound service
command: systemctl enable unbound
# workaround for systemd module expecting running systemd
#systemd:
# name: unbound
# enabled: yes

- name: enable resolvconf
command: systemctl enable resolvconf
# workaround for systemd module expecting running systemd
#systemd:
# name: resolvconf
# enabled: yes
- name: Enable & reload services
when: not dockerenv.stat.exists
systemd:
name: "{{ item }}"
enabled: yes
masked: no
state: reloaded # TODO: This should be a handler instead

- name: enable unbound-resolvconf
command: systemctl enable unbound-resolvconf
# workaround for systemd module expecting running systemd
#systemd:
# name: unbound-resolvconf
# enabled: yes
with_items:
- unbound
- unbound-resolvconf
- resolvconf
11 changes: 3 additions & 8 deletions ansible/tasks/hashbang/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,12 @@

[Install]
WantedBy=timers.target
- command: systemctl enable ansible-pull.service
- command: systemctl enable ansible-pull.timer
- systemd:
name: ansible-pull.service
daemon_reload: true
ignore_errors: true
- systemd:
name: ansible-pull.timer
state: started
daemon_reload: true
ignore_errors: true
enable: yes
daemon_reload: yes
ignore_errors: yes

- name: Install Welcome Templates and Man page
block:
Expand Down
10 changes: 5 additions & 5 deletions ansible/tasks/misc/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
mkfs.ext4 /dev/sda2

- name: enable getty
command: systemctl enable getty@tty1
# workaround for systemd module expecting running systemd
# systemd:
# name: getty@tty1
# enabled: yes
when: not dockerenv.stat.exists
systemd:
name: getty@tty1
enabled: yes


- name: Setup cron job to kill processes of stale accounts
copy:
Expand Down
12 changes: 6 additions & 6 deletions ansible/tasks/tor/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
line: "AllowInbound 1"

- name: enable tor service
command: systemctl enable tor
# workaround for systemd module expecting running systemd
#systemd:
# name: tor
# enabled: yes
# masked: no
systemd:
name: tor
enabled: yes
masked: no
state: started
when: not dockerenv.stat.exists