From 547d9d1fb8b70f3e7972d9eaed1f68fabccd6a02 Mon Sep 17 00:00:00 2001
From: Arthur BOUDREAULT <boudreaultarthur@ik.me>
Date: Tue, 12 Oct 2021 12:41:58 +0200
Subject: [PATCH] =?UTF-8?q?=E2=99=BBrefactor:=20Variable=20naming=20is=20n?=
 =?UTF-8?q?ow=20consistent=20across=20the=20repo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 default/main.yml  |  4 ++--
 tasks/apps.yml    | 11 +++++++----
 tasks/domains.yml |  6 +++---
 tasks/users.yml   |  6 +++---
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/default/main.yml b/default/main.yml
index 59747b2..b8a1fe6 100644
--- a/default/main.yml
+++ b/default/main.yml
@@ -6,7 +6,7 @@ ynh_admin_password: MYINSECUREPWD_PLZ_OVERRIDE_THIS
 
 # The list of Yunohost domains.
 ynh_main_domain: domain.tld
-ynh_extra_domains: ~
+ynh_extra_domains: null
 ynh_ignore_dyndns_server: False
 
 # The list of Yunohost users.
@@ -23,4 +23,4 @@ ynh_apps: null
   #   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).
   #     domain: domain.tld
-  #     path: /ttrss
\ No newline at end of file
+  #     path: /ttrss
diff --git a/tasks/apps.yml b/tasks/apps.yml
index bb73b82..a0e7a50 100644
--- a/tasks/apps.yml
+++ b/tasks/apps.yml
@@ -1,13 +1,16 @@
 ---
 - name: List currently installed apps
   ansible.builtin.shell: yunohost app map --output-as json
-  register: yunohost_installed_apps_raw
+  register: ynh_installed_apps_raw
   changed_when: False
 
 - 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
-  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 }}"
-  when: item.label not in yunohost_installed_apps.values()
+  when: item.label not in ynh_installed_apps.values()
diff --git a/tasks/domains.yml b/tasks/domains.yml
index 404e8c1..db41c0a 100644
--- a/tasks/domains.yml
+++ b/tasks/domains.yml
@@ -1,13 +1,13 @@
 ---
 - name: List currently installed domains
   ansible.builtin.shell: yunohost domain list --output-as json
-  register: yunohost_installed_domains_raw
+  register: ynh_installed_domains_raw
   changed_when: False
 
 - 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
   ansible.builtin.shell: yunohost domain add {{ item }}
   with_items: "{{ ynh_extra_domains }}"
-  when: item not in yunohost_installed_domains.domains
+  when: item not in ynh_installed_domains.domains
diff --git a/tasks/users.yml b/tasks/users.yml
index 00d3a3a..f3e7eb1 100644
--- a/tasks/users.yml
+++ b/tasks/users.yml
@@ -1,11 +1,11 @@
 ---
 - name: List users
   ansible.builtin.shell: yunohost user list --output-as json
-  register: yunohost_registered_users_raw
+  register: ynh_registered_users_raw
   changed_when: False
 
 - 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
   ansible.builtin.shell: |
@@ -15,4 +15,4 @@
     -d {{ item.mail_domain }} \
     -p {{ item.pass }}
   loop: "{{ ynh_users }}"
-  when: item.name not in yunohost_registered_users.users.keys()
+  when: item.name not in ynh_registered_users.users.keys()
-- 
GitLab