Jan Kundrát | 1c2bb58 | 2019-01-10 19:30:43 +0100 | [diff] [blame] | 1 | - name: Prepeare Python env |
| 2 | include_role: |
| 3 | name: el7_centos_python_env |
| 4 | |
Jan Kundrát | 031422b | 2019-01-14 17:11:03 +0100 | [diff] [blame] | 5 | |
| 6 | # PostgreSQL reporter from Zuul |
| 7 | - name: PostgreSQL 10 packages and Python bindings |
| 8 | package: |
| 9 | name: '{{ item }}' |
| 10 | state: present |
| 11 | with_items: |
| 12 | - rh-python36-python-psycopg2 |
| 13 | - rh-postgresql10-postgresql-syspaths |
| 14 | - python-psycopg2 |
| 15 | |
| 16 | - name: PostgreSQL 10 server package |
| 17 | package: |
| 18 | name: rh-postgresql10-postgresql-server |
| 19 | state: present |
| 20 | |
| 21 | - name: postgresql 10 initdb |
| 22 | command: '/opt/rh/rh-postgresql10/root/usr/bin/postgresql-setup --initdb' |
| 23 | args: |
| 24 | creates: /var/opt/rh/rh-postgresql10/lib/pgsql/data/PG_VERSION |
| 25 | become: true |
| 26 | become_user: postgres |
| 27 | |
| 28 | - name: PostgreSQL 10 server service |
| 29 | systemd: |
| 30 | name: rh-postgresql10-postgresql |
| 31 | state: started |
| 32 | enabled: yes |
| 33 | |
| 34 | - name: PostgreSQL Zuul DB |
| 35 | become: yes |
| 36 | become_user: postgres |
| 37 | postgresql_db: |
| 38 | name: zuul |
| 39 | state: present |
| 40 | |
| 41 | - name: PostgreSQL Zuul role |
| 42 | become: yes |
| 43 | become_user: postgres |
| 44 | postgresql_user: |
| 45 | db: zuul |
| 46 | name: zuul |
| 47 | priv: "ALL" |
| 48 | |
Jan Kundrát | 59b0084 | 2019-01-22 20:06:15 +0100 | [diff] [blame] | 49 | - name: script for retrieving Zuul tenant configuration from Gerrit |
| 50 | copy: |
| 51 | dest: /usr/local/bin/zuul-fetch-tenants-from-gerrit.sh |
| 52 | src: files/zuul/zuul-fetch-tenants-from-gerrit.sh |
| 53 | owner: root |
| 54 | group: root |
| 55 | mode: 0755 |
| 56 | |
Jan Kundrát | ecaf7a3 | 2019-01-11 13:00:14 +0100 | [diff] [blame] | 57 | # TODO: this is always marked as 'changed' for some reason... |
Jan Kundrát | 1c2bb58 | 2019-01-10 19:30:43 +0100 | [diff] [blame] | 58 | - name: Install Zuul |
| 59 | include_role: |
| 60 | name: openstack.zuul |
| 61 | vars: |
Jan Kundrát | 9ada9b5 | 2019-01-11 12:20:28 +0100 | [diff] [blame] | 62 | zuul_install_method: pip |
Jan Kundrát | bd3bfda | 2019-03-28 13:00:43 +0100 | [diff] [blame] | 63 | zuul_git_version: '3.7.1' |
Jan Kundrát | 1c2bb58 | 2019-01-10 19:30:43 +0100 | [diff] [blame] | 64 | zuul_pip_executable: /opt/rh/rh-python36/root/bin/pip |
| 65 | zuul_pip_extra_args: "--install-option='--install-scripts=/usr/local/bin'" |
| 66 | zuul_file_zuul_conf_src: files/zuul/zuul.conf |
Jan Kundrát | 59b0084 | 2019-01-22 20:06:15 +0100 | [diff] [blame] | 67 | zuul_file_main_yaml_manage: false |
Jan Kundrát | 1c2bb58 | 2019-01-10 19:30:43 +0100 | [diff] [blame] | 68 | |
| 69 | - name: Provision Zuul SSH directory |
| 70 | file: |
| 71 | path: /var/lib/zuul/.ssh |
| 72 | state: directory |
| 73 | owner: zuul |
| 74 | group: zuul |
| 75 | mode: 0700 |
| 76 | |
| 77 | - name: Provision Zuul SSH private key |
| 78 | copy: |
| 79 | src: ../ansible-cesnet-secrets/zuul/id_rsa |
| 80 | dest: /var/lib/zuul/.ssh/id_rsa |
| 81 | owner: zuul |
| 82 | group: zuul |
| 83 | mode: 0600 |
| 84 | |
| 85 | - name: Gerrit's SSH server pubkey |
| 86 | file: |
| 87 | path: /var/lib/zuul/.ssh/known_hosts |
| 88 | state: touch |
Jan Kundrát | 327e8ae | 2019-01-28 13:30:59 +0100 | [diff] [blame] | 89 | modification_time: preserve |
| 90 | access_time: preserve |
Jan Kundrát | 1c2bb58 | 2019-01-10 19:30:43 +0100 | [diff] [blame] | 91 | owner: zuul |
| 92 | group: zuul |
| 93 | mode: 0600 |
| 94 | |
| 95 | - name: Gerrit's SSH server pubkey content |
| 96 | known_hosts: |
| 97 | path: /var/lib/zuul/.ssh/known_hosts |
| 98 | name: '[gerrit.cesnet.cz]:29418' |
| 99 | key: '[gerrit.cesnet.cz]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCbNpJXucXZHmjFeAVQwc87AeUtyYDULfW/AVfkXbJ86JSzoMfV19GSfPf2v+lVVaEJKrHN4I4X2p2vuTiibFHHXRFuquxltQeAY1wMUthL+x67EfcvptPEslwR134HtNX+fJOrrBx2K2Qvj2/BT9JXQm62NbBBIpIrIyBiMUaCnw==' |
| 100 | |
| 101 | - name: Gerrit's SSH server pubkey content (IPv6 address) |
| 102 | known_hosts: |
| 103 | path: /var/lib/zuul/.ssh/known_hosts |
| 104 | name: '[2001:718:1:1f:50:56ff:feee:163]:29418' |
| 105 | key: '[2001:718:1:1f:50:56ff:feee:163]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCbNpJXucXZHmjFeAVQwc87AeUtyYDULfW/AVfkXbJ86JSzoMfV19GSfPf2v+lVVaEJKrHN4I4X2p2vuTiibFHHXRFuquxltQeAY1wMUthL+x67EfcvptPEslwR134HtNX+fJOrrBx2K2Qvj2/BT9JXQm62NbBBIpIrIyBiMUaCnw==' |
| 106 | |
| 107 | - name: fingergw firewall |
| 108 | firewalld: |
| 109 | zone: public |
| 110 | permanent: yes |
| 111 | state: enabled |
| 112 | port: 79/tcp |
| 113 | immediate: yes |
Jan Kundrát | 84eff46 | 2019-01-11 11:19:06 +0100 | [diff] [blame] | 114 | |
| 115 | - name: Apache modules from SCL |
| 116 | package: |
| 117 | name: 'httpd24-{{ item }}' |
| 118 | state: present |
| 119 | with_items: |
| 120 | - mod_md |
| 121 | - mod_ssl |
| 122 | notify: |
| 123 | - restart apache |
| 124 | |
| 125 | - name: Apache firewall |
| 126 | firewalld: |
| 127 | zone: public |
| 128 | permanent: yes |
| 129 | immediate: yes |
| 130 | state: enabled |
| 131 | service: '{{ item }}' |
| 132 | with_items: |
| 133 | - http |
| 134 | - https |
| 135 | |
| 136 | - name: mpm_prefork disabled |
| 137 | lineinfile: |
| 138 | path: /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-mpm.conf |
| 139 | regexp: '^LoadModule mpm_prefork_module.*' |
| 140 | state: absent |
| 141 | notify: |
| 142 | - restart apache |
| 143 | |
| 144 | - name: mpm_event enabled |
| 145 | lineinfile: |
| 146 | path: /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-mpm.conf |
| 147 | line: 'LoadModule mpm_event_module modules/mod_mpm_event.so' |
| 148 | state: present |
| 149 | notify: |
| 150 | - restart apache |
| 151 | |
| 152 | - name: remove default Apache server admin |
| 153 | lineinfile: |
| 154 | path: /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf |
| 155 | regexp: '^ServerAdmin root.*' |
| 156 | state: absent |
| 157 | notify: |
| 158 | - restart apache |
| 159 | |
| 160 | - name: Apache server admin jan.kundrat@cesnet.cz |
| 161 | lineinfile: |
| 162 | path: /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf |
| 163 | line: 'ServerAdmin mailto:jan.kundrat@cesnet.cz' |
| 164 | state: present |
| 165 | notify: |
| 166 | - restart apache |
| 167 | |
| 168 | - name: Apache LetsEncrypt agreement |
| 169 | lineinfile: |
| 170 | path: /opt/rh/httpd24/root/etc/httpd/conf.d/00-letsencrypt.conf |
| 171 | create: yes |
| 172 | line: 'MDCertificateAgreement https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf' |
| 173 | state: present |
| 174 | notify: |
| 175 | - restart apache |
| 176 | |
| 177 | - name: Apache zuul vhost |
| 178 | copy: |
| 179 | dest: /opt/rh/httpd24/root/etc/httpd/conf.d/20-zuul.gerrit.cesnet.cz.conf |
| 180 | src: files/zuul/vhost.conf |
| 181 | mode: 0644 |
| 182 | notify: |
| 183 | - restart apache |
| 184 | |
| 185 | - name: Apache service |
| 186 | systemd: |
| 187 | name: httpd24-httpd |
| 188 | state: started |
| 189 | enabled: yes |
Jan Kundrát | d920d8c | 2019-01-22 22:35:19 +0100 | [diff] [blame] | 190 | |
| 191 | - name: bubblewrap for Zuul executor |
| 192 | package: |
| 193 | name: bubblewrap |
| 194 | state: present |
Jan Kundrát | d717ad3 | 2019-06-05 23:06:55 +0200 | [diff] [blame] | 195 | |
| 196 | - name: JQ for JSON parsing within Zuul jobs |
| 197 | package: |
| 198 | name: jq |
| 199 | state: present |