summaryrefslogtreecommitdiff
path: root/per-service
diff options
context:
space:
mode:
authorBen Copeland <ben.copeland@linaro.org>2016-11-01 18:14:46 +0000
committerBen Copeland <ben.copeland@linaro.org>2016-11-04 15:56:45 +0000
commit80fa8eb8b8dc70e0da3605dc59728390e8fd1b3d (patch)
treeba4c90fc210ccd4731c2a78f728901657704ec84 /per-service
parentaf52ac37de5a2468b038dda9bcfa01cbe79200db (diff)
downloadansible-playbooks-80fa8eb8b8dc70e0da3605dc59728390e8fd1b3d.tar.gz
ansible-lint: Fix linting error ANSIBLE0017
When using become_user, become: True must be set, otherwise the role will fail. Change-Id: Ia0b2925fa0dc66144f86d7fe4a14d22bcde52796 Reviewed-on: https://review.linaro.org/15159 Reviewed-by: Andy Doan <andy.doan@linaro.org>
Diffstat (limited to 'per-service')
-rw-r--r--per-service/git-servers/roles/gerrit-setup/tasks/gerrit.yml13
-rw-r--r--per-service/git-servers/roles/gitolite/tasks/gitolite-install.yml11
-rw-r--r--per-service/git-servers/roles/gitolite/tasks/gitolite-tools.yml1
-rw-r--r--per-service/git-servers/roles/grokmirror/tasks/master.yml1
-rw-r--r--per-service/jenkins/roles/jenkins-config-skeleton/tasks/main.yml3
5 files changed, 18 insertions, 11 deletions
diff --git a/per-service/git-servers/roles/gerrit-setup/tasks/gerrit.yml b/per-service/git-servers/roles/gerrit-setup/tasks/gerrit.yml
index a5f5d0d..8d7fd39 100644
--- a/per-service/git-servers/roles/gerrit-setup/tasks/gerrit.yml
+++ b/per-service/git-servers/roles/gerrit-setup/tasks/gerrit.yml
@@ -1,3 +1,4 @@
+---
- name: Create Gerrit User
user: name={{git_user}} state=present
tags:
@@ -7,8 +8,7 @@
file: path={{gerrit_root}} owner={{git_user}} group={{git_user}} mode=0755 state=directory
- name: Download Gerrit
- become_user: "{{git_user}}"
- get_url: url={{gerrit_download_link}} dest={{gerrit_root}}/gerrit.war mode=0750
+ get_url: url={{gerrit_download_link}} dest={{gerrit_root}}/gerrit.war mode=0750 owner={{git_user}} group={{git_user}}
tags:
- gerrit-conf
@@ -18,21 +18,20 @@
ignore_errors: True
- name: Initialize Gerrit
+ become: true
become_user: "{{git_user}}"
command: chdir={{gerrit_root}} java -jar gerrit.war init --batch --no-auto-start -d {{gerrit_root}}
when: gerrit_initialized.stat.exists == False
- name: Create Gerrit.conf
- become_user: "{{git_user}}"
- template: src="files/gerrit/{{gerrit_host}}" dest={{gerrit_root}}/etc/gerrit.config
+ template: src="files/gerrit/{{gerrit_host}}" dest={{gerrit_root}}/etc/gerrit.config owner={{git_user}} group={{git_user}}
backup=yes
register: gerrit_conf
tags:
- gerrit-conf
- name: Set up Gerrit secure.conf
- become_user: "{{git_user}}"
- template: src="secure.config" dest={{gerrit_root}}/etc/secure.config
+ template: src="secure.config" dest={{gerrit_root}}/etc/secure.config owner={{git_user}} group={{git_user}}
mode=0600 backup=yes
tags:
- gerrit-conf
@@ -40,6 +39,7 @@
- restart-gerrit
- name: Configure Gerrit
+ become: true
become_user: "{{git_user}}"
command: chdir={{gerrit_root}} java -jar bin/gerrit.war init --batch --no-auto-start -d {{gerrit_root}}
when: gerrit_conf.changed
@@ -53,6 +53,7 @@
register: gerrit_index
- name: Initialize Gerrit index
+ become: true
become_user: "{{git_user}}"
when: gerrit_index.stat.exists == False
command: chdir={{gerrit_root}} java -jar bin/gerrit.war reindex
diff --git a/per-service/git-servers/roles/gitolite/tasks/gitolite-install.yml b/per-service/git-servers/roles/gitolite/tasks/gitolite-install.yml
index a023baf..a439b47 100644
--- a/per-service/git-servers/roles/gitolite/tasks/gitolite-install.yml
+++ b/per-service/git-servers/roles/gitolite/tasks/gitolite-install.yml
@@ -125,7 +125,8 @@
dest=/home/{{ git_user }}/gitolite
update=yes version={{ gitolite_rev }}
accept_hostkey=yes
- become_user: "{{ git_user }}"
+ become: true
+ become_user: "{{git_user}}"
when: hosttype == "git-main"
register: gitolite_updated
tags:
@@ -136,7 +137,9 @@
- name: Run gitolite installation
command: chdir=/home/{{ git_user }}/gitolite
- sudo -u {{ git_user }} -H ./install -ln
+ ./install -ln
+ become: true
+ become_user: "{{git_user}}"
when: "hosttype == 'git-main' and gitolite_updated.changed"
tags:
- git
@@ -148,7 +151,9 @@
- name: Setup gitolite
command: chdir=/home/{{ git_user }}/bin
creates={{ repo_root }}/gitolite-admin.git
- sudo -u {{ git_user }} -H ./gitolite setup -a {{ gitolite_admin_name }}
+ ./gitolite setup -a {{ gitolite_admin_name }}
+ become: true
+ become_user: "{{git_user}}"
when: hosttype == 'git-main'
tags:
- git
diff --git a/per-service/git-servers/roles/gitolite/tasks/gitolite-tools.yml b/per-service/git-servers/roles/gitolite/tasks/gitolite-tools.yml
index d19edd8..b1ba60b 100644
--- a/per-service/git-servers/roles/gitolite/tasks/gitolite-tools.yml
+++ b/per-service/git-servers/roles/gitolite/tasks/gitolite-tools.yml
@@ -42,6 +42,7 @@
- name: Initial fetch of user SSH keys
command: "{{tools_checkout_dir}}/linaro-git-tools/gitolite-tools/gitolite-keys"
when: not gitolite_keys_run.stat.exists
+ become: true
become_user: "{{git_user}}"
tags:
- gitolite
diff --git a/per-service/git-servers/roles/grokmirror/tasks/master.yml b/per-service/git-servers/roles/grokmirror/tasks/master.yml
index fffcc27..d42e181 100644
--- a/per-service/git-servers/roles/grokmirror/tasks/master.yml
+++ b/per-service/git-servers/roles/grokmirror/tasks/master.yml
@@ -7,6 +7,7 @@
when: gitolite_st.stat is defined and gitolite_st.stat.isdir
register: groktrigger
changed_when: "'updating gitolite-admin' in groktrigger.stdout"
+ become: true
become_user: "{{git_user}}"
- name: See if gerrit hook is needed
diff --git a/per-service/jenkins/roles/jenkins-config-skeleton/tasks/main.yml b/per-service/jenkins/roles/jenkins-config-skeleton/tasks/main.yml
index 1f4c5ee..2de44e3 100644
--- a/per-service/jenkins/roles/jenkins-config-skeleton/tasks/main.yml
+++ b/per-service/jenkins/roles/jenkins-config-skeleton/tasks/main.yml
@@ -40,9 +40,8 @@
- Restart Jenkins
- when: not jenkins_managed_config|bool
name: Copy config.xml.ansible to config.xml if configuring first time (fail means config.xml is not updated)
- shell: "cd /var/lib/jenkins; [ ! -f config.xml ] && cp config.xml.ansible config.xml"
+ copy: remote_src=True src=/var/lib/jenkins/config.xml dest=/var/lib/jenkins/config.xml.ansible
ignore_errors: yes
- become_user: jenkins
- name: Create Jenkins external address config
template: src=jenkins-config/hudson.tasks.Mailer.xml