diff --git a/ansible/inventories/setup.yml b/ansible/inventories/setup.yml index 6674cc7..cc4abca 100644 --- a/ansible/inventories/setup.yml +++ b/ansible/inventories/setup.yml @@ -2,6 +2,10 @@ all: vars: ansible_user: centos ansible_ssh_private_key_file: /home/ubuntu/Documents/git_folder/DevOps/ansible/id_rsa + postgres_password: "davidpg" + postgres_user: "davidpg" + postgres_db: "davidpg" children: prod: - hosts: centos@david.jeannin.takima.cloud + hosts: + david.jeannin.takima.cloud: diff --git a/ansible/roles/db_handle/tasks/main.yml b/ansible/roles/db_handle/tasks/main.yml index 15c3ad2..ef08a6e 100644 --- a/ansible/roles/db_handle/tasks/main.yml +++ b/ansible/roles/db_handle/tasks/main.yml @@ -19,9 +19,9 @@ volumes: - "/home/centos/bdd:/var/lib/postgresql/data" env: - POSTGRES_PASSWORD: "davidpg" - POSTGRES_USER: "davidpg" - POSTGRES_DB: "davidpg" + POSTGRES_PASSWORD: "{{ postgres_password }}" + POSTGRES_USER: "{{ postgres_user }}" + POSTGRES_DB: "{{ postgres_db }}" network_mode: "app-network" vars: ansible_python_interpreter: /usr/bin/python3