diff --git a/handlers/main.yml b/handlers/main.yml index df3c0fd8..9361f796 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -16,4 +16,6 @@ - name: Restart apache2 service: name: "{{ horizon_system_service_name }}" + enabled: yes state: "restarted" + daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}" diff --git a/tasks/horizon_apache.yml b/tasks/horizon_apache.yml index b0dc41b7..d682e3f2 100644 --- a/tasks/horizon_apache.yml +++ b/tasks/horizon_apache.yml @@ -41,8 +41,8 @@ template: src: "{{ item.src }}" dest: "{{ item.dest }}" - owner: "{{ item.owner|default(horizon_system_user_name) }}" - group: "{{ item.group|default(horizon_system_group_name) }}" + owner: "{{ item.owner | default(horizon_system_user_name) }}" + group: "{{ item.group | default(horizon_system_group_name) }}" with_items: "{{ horizon_apache_configs }}" notify: Restart apache2 @@ -83,17 +83,11 @@ line: "ServerSignature {{ horizon_apache_serversignature }}" notify: Restart apache2 -# Removing the Listen from apache config to prevent conflick with ports.conf on CentOS -- name: remove Listen from Apache config +# Removing the Listen from apache config to prevent conflicts with ports.conf on CentOS +- name: Remove Listen from Apache config lineinfile: dest: "{{ horizon_apache_security_conf }}" regexp: '^(Listen.*)' backrefs: yes line: '#\1' notify: Restart apache2 - -- name: Load service - service: - name: "{{ horizon_system_service_name }}" - enabled: "yes" - state: "started" diff --git a/tasks/main.yml b/tasks/main.yml index fb0a567c..1c6c55cd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -37,28 +37,29 @@ - horizon-config - include: horizon_db_setup.yml - when: inventory_hostname == groups['horizon_all'][0] + static: no + when: inventory_hostname == ansible_play_hosts[0] tags: - horizon-config - include: horizon_ssl_self_signed.yml static: no when: - - not horizon_external_ssl|bool + - not horizon_external_ssl | bool - horizon_user_ssl_cert is not defined or horizon_user_ssl_key is not defined tags: - horizon-config - include: horizon_ssl_user_provided.yml static: no - when: not horizon_external_ssl|bool + when: not horizon_external_ssl | bool tags: - horizon-config - name: Update the ca certificates command: "update-ca-certificates -f" when: - - not horizon_external_ssl|bool + - not horizon_external_ssl | bool - ansible_pkg_mgr == 'apt' tags: - horizon-config