Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 547d9d1f authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT Committed by Christophe Chaudier
Browse files

:recycle:refactor: Variable naming is now consistent across the repo

parent 989fe3a8
No related branches found
No related tags found
1 merge request!3✅Resolve "refactor vars"
...@@ -6,7 +6,7 @@ ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS ...@@ -6,7 +6,7 @@ ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS
# The list of Yunohost domains. # The list of Yunohost domains.
ynh_main_domain: domain.tld ynh_main_domain: domain.tld
ynh_extra_domains: ~ ynh_extra_domains: null
ynh_ignore_dyndns_server: False ynh_ignore_dyndns_server: False
# The list of Yunohost users. # The list of Yunohost users.
...@@ -23,4 +23,4 @@ ynh_apps: null ...@@ -23,4 +23,4 @@ ynh_apps: null
# link: ttrss # It can be the name of an official ynh app or a git repo link # link: ttrss # It can be the name of an official ynh app or a git repo link
# args: # Provide args here. Domain and path are mandatory, other args depend on the app (cf manifest.json of app). # args: # Provide args here. Domain and path are mandatory, other args depend on the app (cf manifest.json of app).
# domain: domain.tld # domain: domain.tld
# path: /ttrss # path: /ttrss
\ No newline at end of file
--- ---
- name: List currently installed apps - name: List currently installed apps
ansible.builtin.shell: yunohost app map --output-as json ansible.builtin.shell: yunohost app map --output-as json
register: yunohost_installed_apps_raw register: ynh_installed_apps_raw
changed_when: False changed_when: False
- name: Format json of apps - name: Format json of apps
ansible.builtin.set_fact: yunohost_installed_apps="{{ yunohost_installed_apps_raw.stdout | from_json }}" ansible.builtin.set_fact: ynh_installed_apps="{{ ynh_installed_apps_raw.stdout | from_json }}"
- name: Install yunohost apps - name: Install yunohost apps
ansible.builtin.shell: yunohost app install {{ item.link }} --label "{{ item.label }}" --args "{% for key, value in item.args.items() %}{{key}}={{value}}{% if not loop.last %}&{% endif %}{% endfor %}" ansible.builtin.shell: yunohost app install {{ item.link }} \
--label "{{ item.label }}" \
--args "{% for key, value in item.args.items() %}{{ key }}={{ value
}}{% if not loop.last %}&{% endif %}{% endfor %}"
with_items: "{{ ynh_apps }}" with_items: "{{ ynh_apps }}"
when: item.label not in yunohost_installed_apps.values() when: item.label not in ynh_installed_apps.values()
--- ---
- name: List currently installed domains - name: List currently installed domains
ansible.builtin.shell: yunohost domain list --output-as json ansible.builtin.shell: yunohost domain list --output-as json
register: yunohost_installed_domains_raw register: ynh_installed_domains_raw
changed_when: False changed_when: False
- name: Format json of domains - name: Format json of domains
ansible.builtin.set_fact: yunohost_installed_domains="{{ yunohost_installed_domains_raw.stdout | from_json }}" ansible.builtin.set_fact: ynh_installed_domains="{{ ynh_installed_domains_raw.stdout | from_json }}"
- name: Create domains - name: Create domains
ansible.builtin.shell: yunohost domain add {{ item }} ansible.builtin.shell: yunohost domain add {{ item }}
with_items: "{{ ynh_extra_domains }}" with_items: "{{ ynh_extra_domains }}"
when: item not in yunohost_installed_domains.domains when: item not in ynh_installed_domains.domains
--- ---
- name: List users - name: List users
ansible.builtin.shell: yunohost user list --output-as json ansible.builtin.shell: yunohost user list --output-as json
register: yunohost_registered_users_raw register: ynh_registered_users_raw
changed_when: False changed_when: False
- name: Format json of users - name: Format json of users
ansible.builtin.set_fact: yunohost_registered_users="{{ yunohost_registered_users_raw.stdout | from_json }}" ansible.builtin.set_fact: ynh_registered_users="{{ ynh_registered_users_raw.stdout | from_json }}"
- name: Create missing Yunohost users - name: Create missing Yunohost users
ansible.builtin.shell: | ansible.builtin.shell: |
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
-d {{ item.mail_domain }} \ -d {{ item.mail_domain }} \
-p {{ item.pass }} -p {{ item.pass }}
loop: "{{ ynh_users }}" loop: "{{ ynh_users }}"
when: item.name not in yunohost_registered_users.users.keys() when: item.name not in ynh_registered_users.users.keys()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment