Skip to content

Commit

Permalink
Use |changed
Browse files Browse the repository at this point in the history
  • Loading branch information
ypid committed Sep 26, 2017
1 parent 6ca6946 commit ed58573
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
4 changes: 2 additions & 2 deletions tasks/configure_gitlab-pages.yml
Expand Up @@ -92,7 +92,7 @@
GOBIN: '{{ gitlab_app_root_path}}/go/bin'
GOPATH: '{{ gitlab_app_root_path }}/go'
become_user: '{{ gitlab_user }}'
when: gitlab_register_pages_checkout is defined and gitlab_register_pages_checkout.changed
when: gitlab_register_pages_checkout|changed

- name: Setup gitlab-pages
shell: >
Expand All @@ -101,4 +101,4 @@
args:
chdir: '{{ gitlab_pages_checkout }}'
become_user: '{{ gitlab_user }}'
when: gitlab_register_pages_checkout is defined and gitlab_register_pages_checkout.changed
when: gitlab_register_pages_checkout|changed
3 changes: 1 addition & 2 deletions tasks/configure_gitlab-shell.yml
Expand Up @@ -111,5 +111,4 @@
args:
chdir: '{{ gitlab_shell_git_checkout }}'
become_user: '{{ gitlab_user }}'
when: gitlab_register_shell_checkout is defined and gitlab_register_shell_checkout.changed

when: gitlab_register_shell_checkout|changed
33 changes: 16 additions & 17 deletions tasks/configure_gitlab_ce.yml
Expand Up @@ -183,7 +183,7 @@
- name: Install GitLab SysVinit script
shell: cp -f {{ gitlab_ce_git_checkout + "/lib/support/init.d/gitlab" }} /etc/init.d/gitlab
register: gitlab__register_sysvinit_script
when: ((gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed) and
when: (gitlab_register_ce_checkout|changed and
(gitlab_use_systemd is defined and not gitlab_use_systemd))

- name: Install GitLab systemd service files
Expand All @@ -198,7 +198,7 @@
- 'gitlab-workhorse.service'
- '{{ "gitlab-gitaly.service" if (gitlab_version | version_compare("9.0", operator="gt", strict=True)) else [] }}'
register: gitlab__register_systemd_services
when: ((gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed) and
when: (gitlab_register_ce_checkout|changed and
(gitlab_use_systemd is defined and gitlab_use_systemd))

- name: Install GitLab Pages systemd service file
Expand All @@ -207,7 +207,7 @@
dest: '/etc/systemd/system/gitlab-pages.service'
register: gitlab__register_pages_systemd_services
when: (gitlab_enable_pages and
(gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed) and
gitlab_register_ce_checkout|changed and
(gitlab_use_systemd is defined and gitlab_use_systemd))

- name: Reload systemd daemons
Expand All @@ -221,12 +221,12 @@
service:
name: 'gitlab'
enabled: True
when: ((gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed) and
when: (gitlab_register_ce_checkout|changed and
ansible_service_mgr != 'systemd' and not gitlab_use_systemd|bool)

- name: Enable GitLab SysVinit service (systemd)
command: systemctl enable gitlab
when: ((gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed) and
when: (gitlab_register_ce_checkout|changed and
ansible_service_mgr == 'systemd' and not gitlab_use_systemd|bool)

- name: Enable GitLab systemd services
Expand All @@ -240,15 +240,15 @@
- 'gitlab-unicorn.service'
- 'gitlab-workhorse.service'
- '{{ "gitlab-gitaly.service" if (gitlab_version | version_compare("9.0", operator="gt", strict=True)) else [] }}'
when: ((gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed) and
when: (gitlab_register_ce_checkout|changed and
gitlab_use_systemd|bool)

- name: Enable GitLab Pages systemd service
service:
name: 'gitlab-pages.service'
enabled: True
when: (gitlab_enable_pages and
(gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed) and
gitlab_register_ce_checkout|changed and
gitlab_use_systemd|bool)

- name: Setup GitLab CE logrotate configuration
Expand All @@ -268,23 +268,22 @@
chdir: '{{ gitlab_ce_git_checkout }}'
become_user: '{{ gitlab_user }}'
when: gitlab_version | version_compare("8.17", operator="lt", strict=True)
and gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed
and gitlab_register_ce_checkout|changed

- name: Yarn install
shell: yarn install --production
args:
chdir: '{{ gitlab_ce_git_checkout }}'
become_user: '{{ gitlab_user }}'
when: gitlab_version | version_compare("8.17", operator="ge", strict=True)
and gitlab_register_ce_checkout is defined
and gitlab_register_ce_checkout.changed
and gitlab_register_ce_checkout|changed

- name: Update Ruby gems
shell: bundle install --deployment --without {{ gitlab_ce_bundle_install_without[gitlab__database] }}
args:
chdir: '{{ gitlab_ce_git_checkout }}'
become_user: '{{ gitlab_user }}'
when: gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed
when: gitlab_register_ce_checkout|changed

- name: Set default administrator email address and password
replace:
Expand Down Expand Up @@ -312,7 +311,7 @@
(ansible_local.gitlab is undefined or (ansible_local.gitlab is defined and
(ansible_local.gitlab.installed is undefined or (ansible_local.gitlab.installed is defined and
not ansible_local.gitlab.installed)))))) and
gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed and
gitlab_register_ce_checkout|changed and
gitlab__database == 'postgresql')

- name: Reset default administrator email address and password
Expand All @@ -338,7 +337,7 @@
notify: [ 'Restart gitlab', 'Restart gitlab.slice' ]
when: ((ansible_local is defined and ansible_local.gitlab is defined and
ansible_local.gitlab.installed) and
gitlab_register_ce_checkout is defined and gitlab_register_ce_checkout.changed)
gitlab_register_ce_checkout|changed)

- name: Clean GitLab assets
shell: bundle exec rake {{ gitlab_assets_clean }} RAILS_ENV=production
Expand All @@ -347,16 +346,16 @@
become_user: '{{ gitlab_user }}'
when: ((ansible_local is defined and ansible_local.gitlab is defined and
ansible_local.gitlab.installed) and
gitlab_register_bundle_migrate is defined and gitlab_register_bundle_migrate.changed)
gitlab_register_bundle_migrate|changed)

- name: Precompile GitLab assets
shell: bundle exec rake {{ gitlab_assets_compile }} RAILS_ENV=production NODE_ENV=production
args:
chdir: '{{ gitlab_ce_git_checkout }}'
become_user: '{{ gitlab_user }}'
notify: [ 'Restart gitlab', 'Restart gitlab.slice' ]
when: (gitlab_register_bundle_setup_postgresql is defined and gitlab_register_bundle_setup_postgresql.changed) or
(gitlab_register_bundle_migrate is defined and gitlab_register_bundle_migrate.changed)
when: gitlab_register_bundle_setup_postgresql|changed or
gitlab_register_bundle_migrate|changed

- name: Clear GitLab cache
shell: bundle exec rake cache:clear RAILS_ENV=production
Expand All @@ -365,7 +364,7 @@
become_user: '{{ gitlab_user }}'
when: ((ansible_local is defined and ansible_local.gitlab is defined and
ansible_local.gitlab.installed) and
gitlab_register_bundle_migrate is defined and gitlab_register_bundle_migrate.changed)
gitlab_register_bundle_migrate|changed)

- name: Start GitLab instance (SysVinit)
service:
Expand Down

0 comments on commit ed58573

Please sign in to comment.