forked from sylvainar/ansible-yunohost
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgraded code for ansible version 2.10/3
- Loading branch information
Showing
5 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
--- | ||
- name: List currently installed apps | ||
shell: yunohost app map --output-as json | ||
ansible.builtin.shell: yunohost app map --output-as json | ||
register: yunohost_installed_apps_raw | ||
changed_when: False | ||
|
||
- name: Format json of apps | ||
set_fact: yunohost_installed_apps="{{ yunohost_installed_apps_raw.stdout | from_json }}" | ||
ansible.builtin.set_fact: yunohost_installed_apps="{{ yunohost_installed_apps_raw.stdout | from_json }}" | ||
|
||
- name: Install apps | ||
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: "{{ yunohost.apps }}" | ||
when: item.label not in yunohost_installed_apps.values() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
--- | ||
- name: List currently installed domains | ||
shell: yunohost domain list --output-as json | ||
ansible.builtin.shell: yunohost domain list --output-as json | ||
register: yunohost_installed_domains_raw | ||
changed_when: False | ||
|
||
- name: Format json of domains | ||
set_fact: yunohost_installed_domains="{{ yunohost_installed_domains_raw.stdout | from_json }}" | ||
ansible.builtin.set_fact: yunohost_installed_domains="{{ yunohost_installed_domains_raw.stdout | from_json }}" | ||
|
||
- name: Create domains | ||
shell: yunohost domain add {{ item }} | ||
ansible.builtin.shell: yunohost domain add {{ item }} | ||
with_items: "{{ yunohost.extra_domains }}" | ||
when: item not in yunohost_installed_domains.domains |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
--- | ||
- name: List users | ||
shell: yunohost user list --output-as json | ||
ansible.builtin.shell: yunohost user list --output-as json | ||
register: yunohost_registered_users_raw | ||
changed_when: False | ||
|
||
- name: Format json of users | ||
set_fact: yunohost_registered_users="{{ yunohost_registered_users_raw.stdout | from_json }}" | ||
ansible.builtin.set_fact: yunohost_registered_users="{{ yunohost_registered_users_raw.stdout | from_json }}" | ||
|
||
- name: Create missing users | ||
shell: | | ||
ansible.builtin.shell: | | ||
yunohost user create {{ item.name }} \ | ||
-f {{ item.firstname }} \ | ||
-l {{ item.lastname }} \ | ||
-m {{ item.mail }} \ | ||
-p {{ item.pass }} | ||
with_items: "{{ yunohost.users }}" | ||
loop: "{{ yunohost.users }}" | ||
when: item.name not in yunohost_registered_users.users.keys() |