Skip to content

Commit

Permalink
Merge pull request #67 from davidcaste/fix-systemd-test
Browse files Browse the repository at this point in the history
Fix systemd test for Ubuntu Xenial
  • Loading branch information
UnderGreen authored Sep 22, 2016
2 parents d10f291 + d9393b1 commit ec291ba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tasks/install.deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
- include_vars: "{{ansible_distribution}}.yml"

- name: Check if running on systemd
command: cat /proc/1/cmdline
register: systemd
stat: path=/sbin/init
register: sbin_init
changed_when: false
always_run: yes # side-effect free, so it can be run in check-mode as well

- name: Add systemd configuration if present
copy: src=mongodb.service dest=/lib/systemd/system/mongodb.service owner=root group=root mode=0640
when: "'systemd' in systemd.stdout"
when: sbin_init.stat.islnk is defined and sbin_init.stat.islnk

- name: Add symlink for systemd
file: src=/lib/systemd/system/mongodb.service dest=/etc/systemd/system/multi-user.target.wants/mongodb.service state=link
when: "'systemd' in systemd.stdout"
when: sbin_init.stat.islnk is defined and sbin_init.stat.islnk
notify: reload systemd

- meta: flush_handlers
when: "'systemd' in systemd.stdout"
when: sbin_init.stat.islnk is defined and sbin_init.stat.islnk

- name: Add APT key
apt_key:
Expand Down Expand Up @@ -48,7 +48,7 @@
- name: reload systemd
shell: systemctl daemon-reload
changed_when: false
when: "'systemd' in systemd.stdout"
when: sbin_init.stat.islnk is defined and sbin_init.stat.islnk

- name: Install PyMongo package
apt: pkg=python-pymongo state=latest
Expand Down

0 comments on commit ec291ba

Please sign in to comment.