Skip to content
Snippets Groups Projects
shop.yml 4 KiB
Newer Older
---
- name: Setup mariadb
  hosts: all
  become: yes
  roles:
    - role: geerlingguy.mysql
  vars:
    mysql_enabled_on_startup: true
    mysql_packages:
      - mycli
      - mariadb-client
      - mariadb-server
    mysql_root_password_update: true
    mysql_users:
      - name: woops
        host: localhost
        password: 12345678
        priv: "woops.*:ALL"
    mysql_databases:
      - name: woops
        encoding: utf8
        collation: utf8_unicode_ci
    overwrite_global_mycnf: true

- name: Setup and configuration of PHP
  become: yes
  hosts: all
  roles:
    - geerlingguy.php
    - geerlingguy.php-xdebug
    - geerlingguy.mailhog
    - geerlingguy.apache-php-fpm
  vars:
    project_tag: "Liberty Shop"
    sendmail_path: "{{ mailhog_install_dir }}/mhsendmail"
    php_enable_php_fpm: true
    php_fpm_listen: "127.0.0.1:9000"
    php_fpm_listen_allowed_clients: "127.0.0.1"
Noe Nieto's avatar
Noe Nieto committed
    php_packages_extra:
            - php-mysql
            - php-intl
            - php-pear
            - php-imagick
            - php-imap
            - php-mcrypt
            - php-memcache
            - php-pspell
            - php-recode
            - php-sqlite3
            - php-tidy
            - php-xmlrpc
            - php-xsl
    php_enable_webserver: true
    apache_vhosts:
      - servername: "woops.puri.sm"
        documentroot: "/var/www/woops.puri.sm"
        extra_parameters: |
              ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/woops.puri.sm"

- name: Clone the woocommerce subscription plugin and create zipfile
  hosts: localhost
  connection: local
  tasks:
    - name: Git clone
      git:
        repo: git@source.puri.sm:liberty/limited/nda_woocommerce_subscriptions.git
        dest: "{{ shipwright_box_config_home }}/nda_woocommerce_subscriptions"
        version: master
        accept_hostkey: yes
    - name: Create zipfile
      archive:
        path: "{{ shipwright_box_config_home }}/nda_woocommerce_subscriptions/plugins/woocommerce-subscriptions/"
        format: zip
        dest: "{{ shipwright_box_config_home }}/woocommerce-subscriptions.zip"

- name: Clone the LDH username policy plugin for wordpress
  hosts: localhost
  connection: local
  tasks:
    - name: Git clone
      git:
        repo: git@source.puri.sm:liberty/ldh_wp_username_policy.git
        dest: "{{ shipwright_box_config_home }}/ldh_wp_username_policy"
        version: master
        accept_hostkey: yes
    - name: Create zipfile
      archive:
        path: "{{ shipwright_box_config_home }}/ldh_wp_username_policy/"
        format: zip
        dest: "{{ shipwright_box_config_home }}/ldh_wp_username_policy.zip"

- name: Create and setup a wordpress site with woocommerce
  become: yes
  hosts: all
  roles:
    - oefenweb.wordpress
  vars:
    wordpress_installs:
      - name: woops.puri.sm
        dbname: woops
        dbuser: woops
        dbpass: 12345678
        dbhost: localhost
        path: /var/www/woops.puri.sm
        owner: vagrant
        group: vagrant
        recurse: false
        url: http://woops.puri.sm
        title: Purism Liberty Shop
        admin_name: admin
        admin_email: admin@puri.sm
        admin_password: 'MyPa55Pra5e'
        themes:
          - name: twentytwelve
            activate: true
        plugins:
          - name: woocommerce
            activate: true
          - name: woocommerce-subscriptions
            activate: true
            zip: "{{ shipwright_box_config_home }}/woocommerce-subscriptions.zip"
          - name: jwt-authentication-for-wp-rest-api
            activate: true
Noe Nieto's avatar
Noe Nieto committed
          - name: ldh-wp-username-policy
            activate: true
            zip: "{{ shipwright_box_config_home }}/ldh_wp_username_policy.zip"
Noe Nieto's avatar
Noe Nieto committed
        options:
Noe Nieto's avatar
Noe Nieto committed
          - name: woocommerce_api_enabled
            command: update
            value: yes
          - name: swoocommerce_email_from_name
            command: update
Noe Nieto's avatar
Noe Nieto committed
            value: payments@mycompany.com
Noe Nieto's avatar
Noe Nieto committed
          - name: woocommerce_currency
            command: update
        queries: []