change variable

This commit is contained in:
Valentin CZERYBA 2022-12-19 23:46:55 +01:00
parent 1996945eb4
commit 1e3e08b555
3 changed files with 31 additions and 29 deletions

View File

@ -1,12 +1,13 @@
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
39343765633561393532373365313435383266313661663666643731356262633063643761633662 31613733363838323034373330363534363737373764653261366361376236333563646233336163
3732306165616334373164303133336565343939643939330a353635613432313230356237306330 3465613439303661373361663964343338376261323566640a373837646263383965343831306438
39653132363064323961396162383563303334323930396338303566656632663666626337303662 62643130316366653865643438343630306439326431396339623635363630343164366530373464
3338323062366239650a366338346462363565343735643930663338376537343962656534393732 3736333430616261320a376138643533393365326330316634393437393763363566373239626532
36363331353832626261656461636636613332643964336634353963313332356366663739363238 61323331633030316438313563616164366335643331393536666134653339363639393033633935
65356661333639313666383931323363306165643038653164313939376637386666303661363737 34616439383165633035373764386439653336383837653933356439363866373432303364353864
63386466373961623736656635633433333461353435646336323738636334353337313535333663 65653439353538376633653666643765333730363634383361346137623432343939346266383362
30356236363561613630666465663464383965376162653164613431616336336466316330376430 34373638356462353066623930653766353331353936656133636230613264353933616161643139
61396238626364656461666163623234316533663234613931623138376564303236633163626337 64626639343863373933633963633861333739396361323636303535376336663832326261383535
66303734346561613636353239646461626439303537393265353532323233656536663362636164 64623266653562393664323330366564643437383532663163386535643835653362346339653236
656534363934393039623035656335353839 35656339396633356530333266666439373561356133343164643138353230353334373731323861
33393432363632653333

View File

@ -3,42 +3,43 @@
- name: "git archive {{ item }}" - name: "git archive {{ item }}"
local_action: local_action:
module: git module: git
repo: "https://{{ git_username | urlencode }}:{{ git_password | urlencode }}@git.valczeryba.ovh/v4l3n71n/{{ item }}.git" repo: "https://{{ git_username | urlencode }}:{{ git_password | urlencode }}@git.valczeryba.ovh/v4l3n71n/{{ item.name }}.git"
dest: "/home/valentin/src/" dest: "/home/valentin/src/"
archive: "/tmp/{{ item }}.tar.gz" archive: "/tmp/{{ item.name }}.tar.gz"
force: yes force: yes
update: yes update: yes
when: "item.name is defined"
with_items: with_items:
- "{{ project_name }}" - "{{ project }}"
when: "project_name is defined"
- name: "Create directory {{ item }}"
- name: "Create directory "
file: file:
path: "/var/www/{{ item }}" path: "/var/www/{{ item.name }}"
state: directory state: directory
owner: www-data owner: www-data
group: www-data group: www-data
mode: '500' mode: '500'
when: "item.name is defined"
with_items: with_items:
- "{{ project_name }}" - "{{ project }}"
when: "project_name is defined"
vars: vars:
ansible_become: yes ansible_become: yes
ansible_become_method: sudo ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}" ansible_become_password: "{{ sudo_password }}"
- name: "Extract repo {{ item }}" - name: "Extract repo "
unarchive: unarchive:
src: "/tmp/{{ item }}.tar.gz" src: "/tmp/{{ item.name }}.tar.gz"
dest: "/var/www/{{ item }}" dest: "/var/www/{{ item.name }}"
owner: www-data owner: www-data
group: www-data group: www-data
mode: '500' mode: '500'
when: "item.name is defined"
with_items: with_items:
- "{{ project_name }}" - "{{ project }}"
when: "project_name is defined"
vars: vars:
ansible_become: yes ansible_become: yes
ansible_become_method: sudo ansible_become_method: sudo

View File

@ -1,10 +1,10 @@
- name: "Remove all directories" - name: "Remove all directories"
file: file:
path: "/var/www/{{ item }}" path: "/var/www/{{ item.name }}"
state: absent state: absent
when: "item.name is defined and project_name is not defined"
with_items: with_items:
- "{{ project_name }}" - "{{ project }}"
when: "project_name is defined and project is not defined"
vars: vars:
ansible_become: yes ansible_become: yes
ansible_become_method: sudo ansible_become_method: sudo
@ -12,9 +12,9 @@
- name: "Remove single directory" - name: "Remove single directory"
file: file:
path: "/var/www/{{ project }}" path: "/var/www/{{ project_name }}"
state: absent state: absent
when: "project is defined" when: "project_name is defined"
vars: vars:
ansible_become: yes ansible_become: yes
ansible_become_method: sudo ansible_become_method: sudo