server/nextcloud: Combined vars nextcloud_system_user and system_user

wip
Felix Stupp 5 years ago
parent 32c176c93b
commit edb298ebaa
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -2,8 +2,7 @@
domain: "nextcloud.localhost" domain: "nextcloud.localhost"
nextcloud_system_user: "nextcloud" system_user: "nextcloud"
system_user: "{{ nextcloud_system_user }}"
nextcloud_gpg_fingerprint: "28806A878AE423A28372792ED75899B9A724937A" nextcloud_gpg_fingerprint: "28806A878AE423A28372792ED75899B9A724937A"
nextcloud_gpg_key_remote: "https://nextcloud.com/nextcloud.asc" nextcloud_gpg_key_remote: "https://nextcloud.com/nextcloud.asc"
@ -20,7 +19,7 @@ nextcloud_release_file: "{{ nextcloud_user_directory }}/nextcloud.tar.bz2"
nextcloud_release_signature: "{{ nextcloud_release_file }}.asc" nextcloud_release_signature: "{{ nextcloud_release_file }}.asc"
nextcloud_config: "{{ nextcloud_installation_directory }}/config/config.php" nextcloud_config: "{{ nextcloud_installation_directory }}/config/config.php"
database_user: "{{ nextcloud_system_user }}" database_user: "{{ system_user }}"
# database_pass from mysql/database # database_pass from mysql/database
# database_name from mysql/database # database_name from mysql/database

@ -1,7 +1,7 @@
--- ---
- name: Download Nextcloud release - name: Download Nextcloud release
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
get_url: get_url:
url: "{{ nextcloud_release_remote }}" url: "{{ nextcloud_release_remote }}"
checksum: "sha256:{{ nextcloud_release_remote_checksum }}" checksum: "sha256:{{ nextcloud_release_remote_checksum }}"
@ -10,7 +10,7 @@
validate_certs: yes validate_certs: yes
- name: Download signature for Nextcloud release - name: Download signature for Nextcloud release
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
get_url: get_url:
url: "{{ nextcloud_release_remote_signature }}" url: "{{ nextcloud_release_remote_signature }}"
dest: "{{ nextcloud_release_signature }}" dest: "{{ nextcloud_release_signature }}"
@ -19,7 +19,7 @@
validate_certs: yes validate_certs: yes
- name: Receive public key of Nextcloud developers - name: Receive public key of Nextcloud developers
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
command: >- command: >-
"{{ global_helper_directory }}/gpg_import_url_key.sh" "{{ global_helper_directory }}/gpg_import_url_key.sh"
{{ nextcloud_gpg_key_remote | quote }} {{ nextcloud_gpg_key_remote | quote }}
@ -29,7 +29,7 @@
chdir: "{{ nextcloud_user_directory }}" chdir: "{{ nextcloud_user_directory }}"
- name: Validate signature - name: Validate signature
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
command: >- command: >-
/usr/bin/gpg2 /usr/bin/gpg2
--quiet --quiet
@ -40,13 +40,13 @@
chdir: "{{ nextcloud_user_directory }}" chdir: "{{ nextcloud_user_directory }}"
- name: Unpack Nextcloud release - name: Unpack Nextcloud release
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
unarchive: unarchive:
src: "{{ nextcloud_release_file }}" src: "{{ nextcloud_release_file }}"
remote_src: yes remote_src: yes
dest: "{{ nextcloud_user_directory }}" dest: "{{ nextcloud_user_directory }}"
owner: "{{ nextcloud_system_user }}" owner: "{{ system_user }}"
group: "{{ nextcloud_system_user }}" group: "{{ system_user }}"
- name: Remove installation files - name: Remove installation files
file: file:

@ -3,7 +3,7 @@
- name: Configure system user - name: Configure system user
user: user:
state: present state: present
name: "{{ nextcloud_system_user }}" name: "{{ system_user }}"
system: yes system: yes
shell: /bin/false shell: /bin/false
create_home: yes create_home: yes
@ -137,7 +137,7 @@
check_mode: no check_mode: no
- name: Download Nextcloud - name: Download Nextcloud
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
include_tasks: install.yml include_tasks: install.yml
when: not nextcloud_installed.stat.exists when: not nextcloud_installed.stat.exists
@ -145,12 +145,12 @@
file: file:
state: directory state: directory
path: "{{ nextcloud_data_directory }}" path: "{{ nextcloud_data_directory }}"
owner: "{{ nextcloud_system_user }}" owner: "{{ system_user }}"
group: "{{ nextcloud_system_user }}" group: "{{ system_user }}"
mode: "u=rwx,g=rx" mode: "u=rwx,g=rx"
- name: Install Nextcloud - name: Install Nextcloud
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
command: >- command: >-
/usr/bin/php occ maintenance:install /usr/bin/php occ maintenance:install
--database mysql --database mysql
@ -166,7 +166,7 @@
creates: "{{ nextcloud_config }}" creates: "{{ nextcloud_config }}"
- name: Configure Nextcloud default domain - name: Configure Nextcloud default domain
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
lineinfile: lineinfile:
backrefs: yes backrefs: yes
path: "{{ nextcloud_config }}" path: "{{ nextcloud_config }}"
@ -176,7 +176,7 @@
validate: /usr/bin/php %s validate: /usr/bin/php %s
- name: Configure Nextcloud default domain for cli - name: Configure Nextcloud default domain for cli
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
lineinfile: lineinfile:
backrefs: yes backrefs: yes
path: "{{ nextcloud_config }}" path: "{{ nextcloud_config }}"
@ -186,7 +186,7 @@
validate: /usr/bin/php %s validate: /usr/bin/php %s
- name: Install Nextcloud apps - name: Install Nextcloud apps
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
command: "/usr/bin/php occ app:install {{ item | quote }}" command: "/usr/bin/php occ app:install {{ item | quote }}"
args: args:
chdir: "{{ nextcloud_installation_directory }}" chdir: "{{ nextcloud_installation_directory }}"
@ -254,7 +254,7 @@
- workflowengine - workflowengine
- name: Set background job mode to cron - name: Set background job mode to cron
become_user: "{{ nextcloud_system_user }}" become_user: "{{ system_user }}"
command: /usr/bin/php occ background:cron command: /usr/bin/php occ background:cron
args: args:
chdir: "{{ nextcloud_installation_directory }}" chdir: "{{ nextcloud_installation_directory }}"
@ -263,7 +263,7 @@
cron: cron:
name: "nextcloud cron for {{ domain }}" name: "nextcloud cron for {{ domain }}"
minute: "*/5" minute: "*/5"
job: "sudo -u {{ nextcloud_system_user }} php -f \"{{ nextcloud_installation_directory }}/cron.php\"" job: "sudo -u {{ system_user }} php -f \"{{ nextcloud_installation_directory }}/cron.php\""
- name: Configure auto backup of nextcloud data directory - name: Configure auto backup of nextcloud data directory
cron: cron:
@ -274,7 +274,7 @@
state: present state: present
#- name: Upgrade Nextcloud #- name: Upgrade Nextcloud
# become_user: "{{ nextcloud_system_user }}" # become_user: "{{ system_user }}"
# command: /usr/bin/php occ upgrade # command: /usr/bin/php occ upgrade
# args: # args:
# chdir: "{{ nextcloud_installation_directory }}" # chdir: "{{ nextcloud_installation_directory }}"

@ -3,7 +3,7 @@
readonly CHECKSUM_TYPE="sha256"; readonly CHECKSUM_TYPE="sha256";
readonly CHECKSUM_APP="${CHECKSUM_TYPE}sum"; readonly CHECKSUM_APP="${CHECKSUM_TYPE}sum";
readonly GPG_FINGERPRINT="{{ nextcloud_gpg_fingerprint }}"; readonly GPG_FINGERPRINT="{{ nextcloud_gpg_fingerprint }}";
readonly NEXTCLOUD_USER="{{ nextcloud_system_user }}"; readonly NEXTCLOUD_USER="{{ system_user }}";
readonly NEXTCLOUD_DIR="{{ nextcloud_installation_directory }}"; readonly NEXTCLOUD_DIR="{{ nextcloud_installation_directory }}";
readonly NEXTCLOUD_GIT_REPO="{{ nextcloud_source_repo }}"; readonly NEXTCLOUD_GIT_REPO="{{ nextcloud_source_repo }}";

Loading…
Cancel
Save