Sfoglia il codice sorgente

new local fact scheme

master
parent
commit
2b31dddd8d
3 ha cambiato i file con 8 aggiunte e 6 eliminazioni
  1. +1
    -1
      defaults/main.yml
  2. +5
    -3
      tasks/local_facts.yaml
  3. +2
    -2
      vars/main.yml

+ 1
- 1
defaults/main.yml Vedi File

@@ -16,4 +16,4 @@ gitea_admin_email: admin@example.com

gitea_db_name: gitea
gitea_db_user: gitea
gitea_db_pass: "{{ ansible_local.gitea.database_password }}"
gitea_db_pass: "{{ ansible_local[role_name].database_password }}"

+ 5
- 3
tasks/local_facts.yaml Vedi File

@@ -5,10 +5,12 @@
path: /etc/ansible/facts.d
state: directory

- name: set ansible local fact for gitea
- name: set ansible local fact
copy:
content: "{{_gitea_local_facts|to_json}}"
dest: /etc/ansible/facts.d/gitea.fact
content: "{{_local_facts|to_json}}"
dest: /etc/ansible/facts.d/{{role_name}}.fact
register: _local_facts_set

- name: Gathering Facts
setup:
when: _local_facts_set.changed

+ 2
- 2
vars/main.yml Vedi File

@@ -1,5 +1,5 @@
_gitea_local_facts:
database_password: "{% if not ansible_local.gitea.database_password is defined %}{{ lookup('password', '/dev/null length=16 chars=ascii_letters') }}{% else %}{{ ansible_local.gitea.database_password }}{% endif %}"
_local_facts:
database_password: "{% if not ansible_local[role_name].database_password is defined %}{{ lookup('password', '/dev/null length=16 chars=ascii_letters') }}{% else %}{{ ansible_local[role_name].database_password }}{% endif %}"

_gitea_nginx_vhosts:
- name: gitea


Loading…
Annulla
Salva