Browse Source

Fix broken tests, fix behavior on install in CentOS 7.

Jeff Geerling 8 years ago
parent
commit
9373536333
2 changed files with 7 additions and 0 deletions
  1. 1 0
      .travis.yml
  2. 6 0
      tasks/init-setup.yml

+ 1 - 0
.travis.yml

@@ -42,6 +42,7 @@ script:
 
   # Test role.
   - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml'
+  - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml'
 
   # Ensure daemonize is available.
   - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm which daemonize'

+ 6 - 0
tasks/init-setup.yml

@@ -9,6 +9,12 @@
     src: "{{ item.src }}"
     dest: "{{ item.dest }}"
     state: link
+  register: gogs_file_symlinks
   with_items:
     - { src: "{{ gogs_user_home }}/gogs/gogs", dest: "/usr/local/bin/gogs" }
     - { src: "{{ gogs_user_home }}/{{ gogs_init_script_path }}" , dest: "/etc/init.d/gogs" }
+
+# SEE: https://github.com/ansible/ansible-modules-core/issues/191
+- name: Restart systemctl daemon on systemd systems.
+  shell: systemctl daemon-reload
+  when: gogs_file_symlinks.changed and ansible_os_family == "RedHat" and ansible_lsb.major_release|int == 7