Skip to content

Commit

Permalink
Fixed _ce_provision_username using jinja
Browse files Browse the repository at this point in the history
  • Loading branch information
DionisioFG committed May 23, 2024
1 parent fe68ffd commit e72a0d2
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 17 deletions.
10 changes: 7 additions & 3 deletions templates/blank/ce-dev/ansible/provision.yml.j2
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---

- hosts: {{ project_name }}-{{ project_name }}
become: true
vars:
project_name: {{ project_name }}
_domain_name: www.{{ project_name }}.local
_env_type: dev
_ce_provision_username: ce-dev
_venv_path: "/home/ce-dev/ansible"
_venv_command: /usr/bin/python3 -m venv
_venv_install_username: ce-dev
_ce_ansible_timer_name: upgrade_ce_provision_ansible
project_name: {{ project_name }}
is_local: true
rkhunter:
allow_ssh_root_user: prohibit-password
nodejs:
Expand Down
9 changes: 4 additions & 5 deletions templates/drupal10/ce-dev/ansible/provision.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
vars:
_domain_name: www.{{ project_name }}.local
_env_type: dev
_ce_provision_username: "{% if is_local is defined and is_local %}ce-dev{% else %}controller{% endif %}"
_venv_path: "/home/{{ _ce_provision_username }}/ansible"
_ce_provision_username: ce-dev
_venv_path: "/home/ce-dev/ansible"
_venv_command: /usr/bin/python3 -m venv
_venv_install_username: "{{ _ce_provision_username }}"
_venv_install_username: ce-dev
_ce_ansible_timer_name: upgrade_ce_provision_ansible
project_name: {{ project_name }}
is_local: true
rkhunter:
allow_ssh_root_user: prohibit-password
mysql_client:
host: {{ project_name }}-db
user: root
password: ce-dev
ce_provision:
local_dir: /home/ce-dev/ce-provision-2
{% raw %}
nginx:
domains:
Expand Down
24 changes: 15 additions & 9 deletions templates/localgov/ce-dev/ansible/provision.yml.j2
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
- hosts: {{ project_name }}-web
become: true
vars:
- _domain_name: www.{{ project_name }}.local
- _env_type: dev
- project_name: {{ project_name }}
- rkhunter:
allow_ssh_root_user: prohibit-password
- mysql_client:
host: {{ project_name }}-db
user: root
password: ce-dev
_domain_name: www.{{ project_name }}.local
_env_type: dev
_ce_provision_username: ce-dev
_venv_path: "/home/ce-dev/ansible"
_venv_command: /usr/bin/python3 -m venv
_venv_install_username: ce-dev
_ce_ansible_timer_name: upgrade_ce_provision_ansible
project_name: {{ project_name }}
is_local: true
rkhunter:
allow_ssh_root_user: prohibit-password
mysql_client:
host: {{ project_name }}-db
user: root
password: ce-dev
{% raw %}
- nginx:
domains:
Expand Down
41 changes: 41 additions & 0 deletions templates/localgov/ce-dev/ce-dev-devel.compose.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: "3.7"
x-ce_dev:
version: 1.x
registry: localhost:5000
project_name: {{ project_name }}
provision:
- ce-dev/ansible/provision.yml
deploy:
- ce-dev/ansible/deploy.yml
urls:
- https://www.{{ project_name }}.local
services:
web:
image: codeenigma/ce-dev-2.x:latest
platform: linux/amd64
cgroup: host
expose:
- 443
- 80
x-ce_dev:
host_aliases:
- www.{{ project_name }}.local
# Uncomment and comment the "volumes" below to use Unison file sync.
# unison:
# - src: ../
# dest: /home/ce-dev/deploy/live.local
# target_platforms:
# - darwin
# - linux
# ignore:
# - Name vendor
# - Name node_modules
# - Path */sites/*/files
volumes:
- ../:/home/ce-dev/deploy/live.local:delegated
cap_add:
- NET_ADMIN
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: ce-dev

0 comments on commit e72a0d2

Please sign in to comment.