Create users first before starting with nodepool / zuul tasks

It's possible we want to install things like ssh keys or clouds.yaml
files into nodepool / zuul hosts before even starting the installation
process.  This is mostly to workaround issues where nodepool / zuul
will fail to start properly if they are missing.

Change-Id: Ieada13b11678147e9a556f7e76ea17a53bff1010
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-04-15 22:15:04 -04:00
parent a4517c797a
commit 7fd5994937
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
6 changed files with 91 additions and 65 deletions

View File

@ -16,34 +16,6 @@
hosts: nodepool-builder
pre_tasks:
# NOTE(pabelanger): Because of ordering issues with clouds.yaml and
# nodepool, create the required home direcotry first (pre task). So we can
# add the clouds.yaml file.
- name: Create nodepool user directories
include_role:
name: openstack.nodepool
vars:
nodepool_task_manager:
- pre
# TODO(pabelanger): This should be moved into ansible-role-os-client-config.
- name: Create os-client-config directories
become: yes
file:
group: nodepool
owner: nodepool
path: /var/lib/nodepool/.config/openstack
state: directory
- name: Copy clouds.yaml into place
become: yes
copy:
dest: /var/lib/nodepool/.config/openstack/clouds.yaml
group: nodepool
mode: 0400
owner: nodepool
src: "{{ windmill_config_git_dest }}/nodepool/clouds.yaml"
- name: Template disk-image-create wrapper script
become: yes
template:
@ -54,6 +26,10 @@
src: nodepool-builder/usr/local/bin/disk-image-create.j2
tasks:
- name: Setup openstack.ssh role
include_role:
name: openstack.ssh
- name: Setup openstack.sudoers role
include_role:
name: openstack.sudoers
@ -80,10 +56,6 @@
- '--chown=nodepool:nodepool'
src: "{{ windmill_config_git_dest }}/nodepool/elements"
- name: Setup openstack.ssh role
include_role:
name: openstack.ssh
- name: Setup openstack.logrotate role
include_role:
name: openstack.logrotate

View File

@ -15,35 +15,6 @@
- name: Install nodepool-launcher.
hosts: nodepool-launcher
pre_tasks:
# NOTE(pabelanger): Because of ordering issues with clouds.yaml and
# nodepool, create the required home direcotry first (pre task). So we can
# add the clouds.yaml file.
- name: Create nodepool user directories.
include_role:
name: openstack.nodepool
vars:
nodepool_task_manager:
- pre
# TODO(pabelanger): This should be moved into ansible-role-os-client-config.
- name: Create os-client-config directories.
become: yes
file:
group: nodepool
owner: nodepool
path: /var/lib/nodepool/.config/openstack
state: directory
- name: Copy clouds.yaml into place.
become: yes
copy:
dest: /var/lib/nodepool/.config/openstack/clouds.yaml
group: nodepool
mode: 0400
owner: nodepool
src: "{{ windmill_config_git_dest }}/nodepool/clouds.yaml"
tasks:
- name: Setup openstack.shade role
include_role:

49
playbooks/nodepool.yaml Normal file
View File

@ -0,0 +1,49 @@
# Copyright 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Install nodepool
hosts: nodepool
# TODO(pabelanger): We really don't want to use serial here, but this allows
# us to still support a single node install. What we should do here is expose
# some sort of variable to only toggle this when we are doing a single node
# install. Otherwise, we just slow down multinode deployments.
serial: 1
tasks:
# NOTE(pabelanger): Because of ordering issues create the required home
# directory first.
- name: Create nodepool user directories.
include_role:
name: openstack.nodepool
vars:
nodepool_task_manager:
- pre
# TODO(pabelanger): This should be moved into ansible-role-os-client-config.
- name: Create os-client-config directories.
become: yes
file:
group: nodepool
owner: nodepool
path: /var/lib/nodepool/.config/openstack
state: directory
- name: Copy clouds.yaml into place.
become: yes
copy:
dest: /var/lib/nodepool/.config/openstack/clouds.yaml
group: nodepool
mode: 0400
owner: nodepool
src: "{{ windmill_config_git_dest }}/nodepool/clouds.yaml"

View File

@ -16,8 +16,10 @@
- include: statsd.yaml
- include: gear.yaml
- include: zookeeper.yaml
- include: nodepool.yaml
- include: nodepool-builder.yaml
- include: nodepool-launcher.yaml
- include: zuul.yaml
- include: zuul-scheduler.yaml
- include: zuul-executor.yaml
- include: zuul-fingergw.yaml

View File

@ -16,6 +16,10 @@
hosts: zuul-scheduler
tasks:
- name: Setup openstack.ssh role.
include_role:
name: openstack.ssh
- name: Setup openstack.zuul role.
include_role:
name: openstack.zuul
@ -24,10 +28,6 @@
include_role:
name: openstack.logrotate
- name: Setup openstack.ssh role.
include_role:
name: openstack.ssh
post_tasks:
- name: Run zuul-scheduler validation.
include_role:

32
playbooks/zuul.yaml Normal file
View File

@ -0,0 +1,32 @@
# Copyright 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Install zuul
hosts: zuul
# TODO(pabelanger): We really don't want to use serial here, but this allows
# us to still support a single node install. What we should do here is expose
# some sort of variable to only toggle this when we are doing a single node
# install. Otherwise, we just slow down multinode deployments.
serial: 1
tasks:
# NOTE(pabelanger): Because of ordering issues create the required home
# directory first.
- name: Create zuul user directories.
include_role:
name: openstack.zuul
vars:
zuul_task_manager:
- pre