site.yml 1.46 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 14
      - role: geerlingguy.mysql
      - role: geerlingguy.php
      - role: geerlingguy.php-mysql
      - role: geerlingguy.certbot
15
      - role: geerlingguy.apache
16 17 18
        vars:
            # Each apps/site will define it's own vhost file, so not really needed here.
            - apache_create_vhosts: false
19 20

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

- hosts: rp
  environment:
      ANSIBLE_VAULT_PASSWORD_FILE: /root/.ansible.vault
  remote_user: root
  roles:
38 39 40 41 42 43 44 45 46 47 48 49
      - 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
50 51
      - role: simplifield.node
      - role: rp