|
| 1 | +--- |
| 2 | +- hosts: localhost |
| 3 | + connection: local |
| 4 | + vars: |
| 5 | + stackhead__tf_project_folder: "." |
| 6 | + stackhead__certificates_project_folder: ".stackhead/certificates/{{ project_name }}" |
| 7 | + stackhead__snakeoil_fullchain: ".stackhead/global_certificates/fullchain_snakeoil.pem" |
| 8 | + stackhead__snakeoil_privkey: ".stackhead/global_certificates/privkey_snakeoil.pem" |
| 9 | + project_name: test |
| 10 | + app_config: |
| 11 | + domains: |
| 12 | + - domain: example.com |
| 13 | + expose: |
| 14 | + - service: php |
| 15 | + internal_port: 5000 |
| 16 | + external_port: 5000 |
| 17 | + - service: nginx |
| 18 | + internal_port: 80 |
| 19 | + external_port: 80 |
| 20 | + security: |
| 21 | + authentication: |
| 22 | + - type: basic |
| 23 | + username: user1 |
| 24 | + password: pass1 |
| 25 | + - domain: test.example.com |
| 26 | + expose: |
| 27 | + - service: php |
| 28 | + internal_port: 5000 |
| 29 | + external_port: 80 |
| 30 | + security: |
| 31 | + authentication: |
| 32 | + - type: basic |
| 33 | + username: user1 |
| 34 | + password: pass1 |
| 35 | + - type: basic |
| 36 | + username: user2 |
| 37 | + password: pass2 |
| 38 | + container: |
| 39 | + registries: |
| 40 | + - username: dockerhub-user |
| 41 | + password: dockerhub-pass |
| 42 | + - username: myregistry-user |
| 43 | + password: myregistry-pass |
| 44 | + url: myregistry.com |
| 45 | + services: |
| 46 | + - name: data |
| 47 | + image: mycontainer:latest |
| 48 | + - name: nginx |
| 49 | + image: getstackhead/nginx:php |
| 50 | + environment: |
| 51 | + NGINX_PUBLIC_DIRECTORY: public |
| 52 | + DOCKER_PROXY_SERVICE_NAME: "$DOCKER_SERVICE_NAME['php']" |
| 53 | + volumes: |
| 54 | + - type: global |
| 55 | + src: data |
| 56 | + dest: /var/www/public/data |
| 57 | + mode: ro |
| 58 | + - type: global |
| 59 | + src: uploads |
| 60 | + dest: /var/www/public/uploads |
| 61 | + mode: ro |
| 62 | + volumes_from: |
| 63 | + - data:ro |
| 64 | + - name: php |
| 65 | + image: getstackhead/php:7.2 |
| 66 | + volumes_from: |
| 67 | + - data |
| 68 | + volumes: |
| 69 | + - type: global |
| 70 | + src: fileadmin |
| 71 | + dest: /var/www/public/fileadmin |
| 72 | + - type: global |
| 73 | + src: uploads |
| 74 | + dest: /var/www/public/uploads |
| 75 | + - type: global |
| 76 | + src: typo3temp |
| 77 | + dest: /var/www/public/typo3temp |
| 78 | + - type: global |
| 79 | + src: var |
| 80 | + dest: /var/www/var |
| 81 | + - name: db |
| 82 | + image: mariadb |
| 83 | + environment: |
| 84 | + MYSQL_ROOT_PASSWORD: db |
| 85 | + MYSQL_DATABASE: db |
| 86 | + MYSQL_USER: db |
| 87 | + MYSQL_PASSWORD: db |
| 88 | + volumes: |
| 89 | + - type: local |
| 90 | + src: data |
| 91 | + dest: /var/lib/mysql |
| 92 | + tasks: |
| 93 | + - set_fact: |
| 94 | + containerapp__expose: "{{ containerapp__expose|default([]) + item.expose }}" |
| 95 | + when: item.expose is defined and item.expose not in containerapp__expose|default([]) |
| 96 | + with_items: "{{ app_config.domains }}" |
| 97 | + - block: |
| 98 | + - name: Generate Nginx Server Block Terraform file |
| 99 | + import_tasks: "{{ role_path }}/tasks/steps/generate-serverblock-tf.yml" |
| 100 | + - name: Generate htpasswd Terraform file |
| 101 | + import_tasks: "{{ role_path }}/tasks/steps/generate-htpasswd-tf.yml" |
| 102 | + vars: |
| 103 | + role_path: ".." |
| 104 | + nginx_usehttps: 1 |
| 105 | + nginx_servername: "test_project" |
| 106 | + stackhead__acme_folder: "" |
| 107 | + nginx_htpasswd_path: /etc/nginx/passwd |
| 108 | + nginx_basicauth_title: "Restricted area" |
0 commit comments