-
18 Nov 2020 13:02:29 +0000
18 Nov 2020 13:02:29 +000000:00:00.24Ansible 2.10.3CLI arguments
Argument Value
/home/travis/.ansible/roles/robertdebock.httpd/tasks/main.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | --- # tasks file for httpd - name: include assert.yml include_tasks: assert.yml run_once: yes - name: install apache httpd package: name: "{{ httpd_packages }}" state: present - name: modify selinux settings seboolean: name: "{{ item }}" state: yes persistent: yes when: - ansible_selinux.status is defined - ansible_selinux.status == "enabled" loop: "{{ httpd_sebooleans }}" - name: allow connections to custom port seport: ports: "{{ item }}" proto: tcp setype: http_port_t state: present when: - ansible_selinux.status is defined - ansible_selinux.status == "enabled" loop: - "{{ httpd_port }}" - "{{ httpd_ssl_port }}" - name: configure ssl template: src: ssl.conf.j2 dest: "{{ httpd_config_directory }}/ssl.conf" mode: "0644" notify: - test httpd configuration validity - restart httpd - name: configure locations template: src: location.conf.j2 dest: "{{ httpd_config_directory }}/{{ item.name }}.conf" mode: "0644" loop: "{{ httpd_locations }}" notify: - test httpd configuration validity - restart httpd when: - httpd_locations is defined loop_control: label: "{{ item.name }}" - name: configure vhosts template: src: vhost.conf.j2 dest: "{{ httpd_config_directory }}/{{ item.name }}.conf" mode: "0644" loop: "{{ httpd_vhosts }}" notify: - test httpd configuration validity - restart httpd when: - httpd_vhosts is defined loop_control: label: "{{ item.name }}" - name: configure httpd template: src: "{{ httpd_config_src }}" dest: "{{ httpd_config_dest }}" mode: "0644" notify: - test httpd configuration validity - restart httpd - name: configure listening ports template: src: "{{ httpd_ports_conf }}.j2" dest: "{{ httpd_server_root }}/{{ httpd_ports_conf }}" mode: "0644" notify: - test httpd configuration validity - restart httpd when: - ansible_os_family == "Debian" or ansible_os_family == "Suse" - name: configure redirect from http to https template: src: default_vhost.conf.j2 dest: "{{ httpd_config_directory }}/default_vhost.conf" mode: "0644" notify: - test httpd configuration validity - restart httpd - name: create docroot file: path: "{{ item.documentroot }}" state: directory mode: "0755" loop: "{{ httpd_vhosts }}" when: - httpd_vhosts is defined - item.documentroot is defined - name: flush handlers meta: flush_handlers - name: start and enable httpd service: name: "{{ httpd_service }}" state: started enabled: yes |