site.yml 1.48 KB
Newer Older
1 2
---
# Playbook principal pour piops
okhin's avatar
okhin committed
3
# Permet d'installer ansible et d'installer un cronjob pour ansible-pull
4

okhin's avatar
okhin committed
5
- hosts: all
6 7
  remote_user: root

okhin's avatar
okhin committed
8
- hosts: webserver,wordpress,rp
9 10
  remote_user: root
  roles:
okhin's avatar
okhin committed
11 12 13
      - role: geerlingguy.mysql
      - role: geerlingguy.php
      - role: geerlingguy.php-mysql
okhin's avatar
okhin committed
14
      - role: alternc
okhin's avatar
okhin committed
15
      - role: geerlingguy.certbot
16
      - role: geerlingguy.apache
17 18 19
        vars:
            # Each apps/site will define it's own vhost file, so not really needed here.
            - apache_create_vhosts: false
20 21

- hosts: wordpress
22 23
  environment:
      ANSIBLE_VAULT_PASSWORD_FILE: /root/.ansible.vault
24 25
  remote_user: root
  roles:
26 27 28 29 30
      - role: geerlingguy.apache
        vars:
            - webserver_user: www-data
            - apache_vhosts_filename: wordpress.conf
            - apache_vhosts: "{{ wordpress_vhost }}"
okhin's avatar
okhin committed
31
      - role: wpcli
okhin's avatar
okhin committed
32
      - role: wordpress
okhin's avatar
okhin committed
33 34 35 36 37 38

- hosts: rp
  environment:
      ANSIBLE_VAULT_PASSWORD_FILE: /root/.ansible.vault
  remote_user: root
  roles:
39 40 41 42 43 44 45 46 47 48 49 50
      - role: geerlingguy.apache
        vars:
            - apache_packages:
                - libapache2-mod-proxy-uwsgi
                - libapache2-mod-uwsgi
            - apache_mods_enabled: 
                - uwsgi.load 
                - proxy_uwsgi.load
            - webserver_user: www-data
            - apache_vhosts_filename: rp.conf
            - apache_vhosts_template: templates/uwsgi_apache.conf.j2
            - apache_vhosts: "{{ rp_vhost }}"
okhin's avatar
okhin committed
51 52
      - role: simplifield.node
      - role: rp