Add ansible 2.0 support
Change-Id: Ieaa3b3b5c7cb5dd36ef468801f1510a4aa98a647 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
e08a313323
commit
53ef2040ec
|
@ -14,13 +14,13 @@
|
||||||
---
|
---
|
||||||
# tasks/config.yaml
|
# tasks/config.yaml
|
||||||
zuul_user_name: zuul
|
zuul_user_name: zuul
|
||||||
zuul_user_group: "{{ zuul_user_name }}"
|
zuul_user_group: zuul
|
||||||
zuul_user_home: "/var/lib/{{ zuul_user_name }}"
|
zuul_user_home: /var/lib/zuul
|
||||||
|
|
||||||
zuul_file_layout_dest: /etc/zuul/config/
|
zuul_file_layout_dest: /etc/zuul/config/
|
||||||
zuul_file_layout_group: "{{ ansible_ssh_user }}"
|
zuul_file_layout_group: "{{ ansible_user }}"
|
||||||
zuul_file_layout_mode: "0755"
|
zuul_file_layout_mode: "0755"
|
||||||
zuul_file_layout_owner: "{{ ansible_ssh_user }}"
|
zuul_file_layout_owner: "{{ ansible_user }}"
|
||||||
zuul_file_layout_src: etc/zuul/config/
|
zuul_file_layout_src: etc/zuul/config/
|
||||||
|
|
||||||
zuul_config_gearman_port: 4730
|
zuul_config_gearman_port: 4730
|
||||||
|
|
|
@ -13,15 +13,15 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
---
|
---
|
||||||
- name: Reload zuul-merger
|
- name: Reload zuul-merger
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: zuul-merger
|
name: zuul-merger
|
||||||
state: reloaded
|
state: reloaded
|
||||||
sudo: yes
|
|
||||||
when: zuul_service_zuul_merger_state == "started" and not __zuul_merger_service.changed
|
when: zuul_service_zuul_merger_state == "started" and not __zuul_merger_service.changed
|
||||||
|
|
||||||
- name: Reload zuul-server
|
- name: Reload zuul-server
|
||||||
|
become: yes
|
||||||
service:
|
service:
|
||||||
name: zuul-server
|
name: zuul-server
|
||||||
state: reloaded
|
state: reloaded
|
||||||
sudo: yes
|
|
||||||
when: zuul_service_zuul_server_state == "started" and not __zuul_server_service.changed
|
when: zuul_service_zuul_server_state == "started" and not __zuul_server_service.changed
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
ansible<2.0
|
ansible>=2.0.0
|
||||||
|
|
|
@ -13,10 +13,12 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
---
|
---
|
||||||
- name: Create group account.
|
- name: Create group account.
|
||||||
|
become: yes
|
||||||
group:
|
group:
|
||||||
name: "{{ zuul_user_group }}"
|
name: "{{ zuul_user_group }}"
|
||||||
|
|
||||||
- name: Create user account.
|
- name: Create user account.
|
||||||
|
become: yes
|
||||||
user:
|
user:
|
||||||
createhome: yes
|
createhome: yes
|
||||||
home: "{{ zuul_user_home }}"
|
home: "{{ zuul_user_home }}"
|
||||||
|
@ -24,6 +26,7 @@
|
||||||
name: "{{ zuul_user_name }}"
|
name: "{{ zuul_user_name }}"
|
||||||
|
|
||||||
- name: Create required directories.
|
- name: Create required directories.
|
||||||
|
become: yes
|
||||||
file:
|
file:
|
||||||
group: "{{ zuul_user_group }}"
|
group: "{{ zuul_user_group }}"
|
||||||
owner: "{{ zuul_user_name }}"
|
owner: "{{ zuul_user_name }}"
|
||||||
|
@ -34,6 +37,7 @@
|
||||||
- /var/log/zuul
|
- /var/log/zuul
|
||||||
|
|
||||||
- name: Template zuul configuration file.
|
- name: Template zuul configuration file.
|
||||||
|
become: yes
|
||||||
template:
|
template:
|
||||||
dest: "{{ zuul_template_zuul_conf_dest }}"
|
dest: "{{ zuul_template_zuul_conf_dest }}"
|
||||||
src: "{{ zuul_template_zuul_conf_src }}"
|
src: "{{ zuul_template_zuul_conf_src }}"
|
||||||
|
@ -42,24 +46,28 @@
|
||||||
- Reload zuul-server
|
- Reload zuul-server
|
||||||
|
|
||||||
- name: Copy gearman logging file.
|
- name: Copy gearman logging file.
|
||||||
|
become: yes
|
||||||
copy:
|
copy:
|
||||||
dest: "{{ zuul_config_gearman_server_log_config }}"
|
dest: "{{ zuul_config_gearman_server_log_config }}"
|
||||||
src: "{{ zuul_file_gearman_logging_conf }}"
|
src: "{{ zuul_file_gearman_logging_conf }}"
|
||||||
notify: Reload zuul-server
|
notify: Reload zuul-server
|
||||||
|
|
||||||
- name: Copy merger logging file.
|
- name: Copy merger logging file.
|
||||||
|
become: yes
|
||||||
copy:
|
copy:
|
||||||
dest: "{{ zuul_config_merger_log_config }}"
|
dest: "{{ zuul_config_merger_log_config }}"
|
||||||
src: "{{ zuul_file_merger_logging_conf }}"
|
src: "{{ zuul_file_merger_logging_conf }}"
|
||||||
notify: Reload zuul-merger
|
notify: Reload zuul-merger
|
||||||
|
|
||||||
- name: Copy server logging file.
|
- name: Copy server logging file.
|
||||||
|
become: yes
|
||||||
copy:
|
copy:
|
||||||
dest: "{{ zuul_config_zuul_log_config }}"
|
dest: "{{ zuul_config_zuul_log_config }}"
|
||||||
src: "{{ zuul_file_server_logging_conf }}"
|
src: "{{ zuul_file_server_logging_conf }}"
|
||||||
notify: Reload zuul-server
|
notify: Reload zuul-server
|
||||||
|
|
||||||
- name: Create layout config directory.
|
- name: Create layout config directory.
|
||||||
|
become: yes
|
||||||
file:
|
file:
|
||||||
dest: "{{ zuul_file_layout_dest }}"
|
dest: "{{ zuul_file_layout_dest }}"
|
||||||
group: "{{ zuul_file_layout_group }}"
|
group: "{{ zuul_file_layout_group }}"
|
||||||
|
@ -68,7 +76,7 @@
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Rsync layout configuration.
|
- name: Rsync layout configuration.
|
||||||
sudo: no
|
become: no
|
||||||
synchronize:
|
synchronize:
|
||||||
delete: yes
|
delete: yes
|
||||||
dest: "{{ zuul_file_layout_dest }}"
|
dest: "{{ zuul_file_layout_dest }}"
|
||||||
|
|
|
@ -16,10 +16,9 @@
|
||||||
include_vars: "{{ ansible_os_family }}.yaml"
|
include_vars: "{{ ansible_os_family }}.yaml"
|
||||||
|
|
||||||
- include: install.yaml
|
- include: install.yaml
|
||||||
sudo: yes
|
become: yes
|
||||||
|
|
||||||
- include: config.yaml
|
- include: config.yaml
|
||||||
sudo: yes
|
|
||||||
|
|
||||||
- include: service.yaml
|
- include: service.yaml
|
||||||
sudo: yes
|
become: yes
|
||||||
|
|
|
@ -1,2 +1,6 @@
|
||||||
[all]
|
[all]
|
||||||
localhost
|
# NOTE(pabelanger): We should not be hard-coding jenkins here, since it limits
|
||||||
|
# who can run this test. However, ansible 2.0 has broken ansible_user and it
|
||||||
|
# now requires to be setup, otherwise it will return nil[1].
|
||||||
|
# [1] https://github.com/ansible/ansible/issues/13669
|
||||||
|
localhost ansible_user=jenkins
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
sudo: yes
|
become: yes
|
||||||
vars:
|
vars:
|
||||||
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
|
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
|
|
Loading…
Reference in New Issue