Skip to content

Commit

Permalink
lineinfile does not work with embedded newlines, add a kiwix-serve re…
Browse files Browse the repository at this point in the history
…start at 15 minutes past the hour
  • Loading branch information
georgejhunt committed Feb 9, 2017
1 parent 7f93c09 commit 2a62885
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions roles/kiwix/tasks/kiwix_install.yml
Expand Up @@ -71,6 +71,12 @@
- name: Set kiwix ownership
command: "chown -R root:root {{ xsce_base }}"

# workaround because kiwix-serve does not stay running
- name: Make an entry in crontab to restart every hour
# * * * * * user-name command to be executed
lineinfile: line="15 * * * * root systemctl restart kiwix-serve.service"
dest=/etc/crontab

# Create kiwix service

- name: Create kiwix-serve service
Expand Down
7 changes: 6 additions & 1 deletion roles/network/tasks/restart.yml
Expand Up @@ -17,7 +17,12 @@
register: dns_started

- name: add a reference to name server in resolv.conf
lineinfile: line="#Added by XSCE\nnameserver 127.0.0.1\nsearch {{xsce_domain}}"
lineinfile: line="nameserver 127.0.0.1"
dest=/etc/resolvconf/resolv.conf.d/head
when: named_enabled and is_debian and dns_started.changed

- name: add a reference search in resolv.conf
lineinfile: line="search {{ xsce_domain }}"
dest=/etc/resolvconf/resolv.conf.d/head
when: named_enabled and is_debian and dns_started.changed

Expand Down

0 comments on commit 2a62885

Please sign in to comment.