--- - import_playbook: "include/deploy-kvm-guest.yml myhosts=proxy" - name: configure instance hosts: proxy user: root gather_facts: true vars_files: - "{{ ansible_private }}/vars.yml" roles: - base - relayd - ifstated - nginx/server - role: nginx/site site: foo.sh redirect: https://www.foo.sh/ - role: nginx/site site: autoconfig.foo.sh - role: nginx/site site: boot.foo.sh - role: nginx/site site: bitbucket.foo.sh redirect: https://bitbucket.org/tmakinen/ - role: nginx/site site: certbot.home.foo.sh proxy: https://certbot.home.foo.sh/ - role: nginx/site site: collab.foo.sh proxy: https://collab01.home.foo.sh/ - role: nginx/site site: devel01.foo.sh proxy: https://devel01.home.foo.sh/ - role: nginx/site site: git.foo.sh proxy: https://git02.home.foo.sh/ - role: nginx/site site: id.foo.sh proxy: [ldap01.home.foo.sh, ldap02.home.foo.sh] - role: nginx/site site: ldap.foo.sh redirect: https://www.foo.sh/ - role: nginx/site site: ldap01.foo.sh redirect: https://ldap.foo.sh/ - role: nginx/site site: mirrors.foo.sh proxy: https://mirror01.home.foo.sh/ - role: nginx/site site: print.foo.sh proxy: https://print01.home.foo.sh/ - role: nginx/site site: wpad.foo.sh - role: nginx/site site: www.foo.sh tasks: - name: create extra nginx config directories file: path: /etc/nginx/conf.d/www.foo.sh state: directory mode: 0755 owner: root group: "{{ ansible_wheel }}" - name: install redirects config for www.foo.sh copy: dest: /etc/nginx/conf.d/www.foo.sh/redirects.conf content: | location /collab/ { return 301 https://collab.foo.sh/; } mode: 0644 owner: root group: "{{ ansible_wheel }}" notify: restart nginx - name: install proxy config for www.foo.sh copy: dest: /etc/nginx/conf.d/www.foo.sh/proxy.conf content: | location /roles/ { proxy_pass https://static02.home.foo.sh/roles/; } location /~ { proxy_pass https://static02.home.foo.sh/~; } mode: 0644 owner: root group: "{{ ansible_wheel }}" notify: restart nginx