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
Okhin's avatar
Okhin committed
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:
Okhin's avatar
Okhin committed
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:
Okhin's avatar
Okhin committed
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