diff --git a/tasks/cdh_deb.yml b/tasks/cdh_deb.yml index fe54ebc..b39c0db 100644 --- a/tasks/cdh_deb.yml +++ b/tasks/cdh_deb.yml @@ -22,4 +22,15 @@ - name: Start and enable the scm agent service: name=cloudera-scm-agent state=started enabled=yes + - name: "Check if apache is installed" + package_facts: + manager: "auto" + when: cdh_manager_install + + - name: Stop and disable the apache service on CDM + service: name=apache2 state=stopped enabled=no + when: + - cdh_manager_install + - "'apache2' in ansible_facts.packages" + tags: [ 'cdh', 'hadoop' ] diff --git a/tasks/cdh_el.yml b/tasks/cdh_el.yml index 55b0f1b..418198c 100644 --- a/tasks/cdh_el.yml +++ b/tasks/cdh_el.yml @@ -1,5 +1,5 @@ --- -- name: CentOS packages and firewall rules +- name: EL packages and firewall rules block: - name: Firewalld rules for CDH firewalld: port={{ item.port }}/{{ item.protocol }} zone={{ item.zone }} permanent={{ item.permanent | default(True) }} state={{ item.state }} immediate=True @@ -18,5 +18,16 @@ - name: Start and enable the scm agent service: name=cloudera-scm-agent state=started enabled=yes - + + - name: Get the installed packages list + package_facts: + manager: "auto" + when: cdh_manager_install + + - name: Stop and disable the apache service on CDM + service: name=httpd state=stopped enabled=no + when: + - cdh_manager_install + - "'httpd' in ansible_facts.packages" + tags: [ 'cdh', 'hadoop' ]