At the moment, we don't have a good control on when to actually restart nodepool. So, it is possible weird things can happen. Also, most of the configuration of nodepool is read in realtime, so reloads are really needed. Change-Id: Ice81ffb8ecd08b88e42ef1eb775720ed1744e08c Signed-off-by: Paul Belanger <pabelanger@redhat.com>
97 lines
2.6 KiB
YAML
97 lines
2.6 KiB
YAML
# Copyright 2015 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: Create group account.
|
|
group:
|
|
name: "{{ nodepool_user_group }}"
|
|
|
|
- name: Create user account.
|
|
user:
|
|
createhome: yes
|
|
home: "{{ nodepool_user_home }}"
|
|
group: "{{ nodepool_user_group }}"
|
|
name: "{{ nodepool_user_name }}"
|
|
|
|
- name: Create required directories.
|
|
file:
|
|
group: "{{ nodepool_user_group }}"
|
|
owner: "{{ nodepool_user_name }}"
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- /etc/nodepool
|
|
- "{{ nodepool_config_images_dir }}"
|
|
- "{{ nodepool_user_home }}/.config/openstack"
|
|
- /var/log/nodepool
|
|
|
|
- name: Template clouds yaml file.
|
|
template:
|
|
dest: "{{ nodepool_template_clouds_yaml_dest }}"
|
|
src: "{{ nodepool_template_clouds_yaml_src }}"
|
|
|
|
- name: Template secure configuration file.
|
|
template:
|
|
dest: "{{ nodepool_template_secure_conf_dest }}"
|
|
src: "{{ nodepool_template_secure_conf_src }}"
|
|
|
|
- name: Template yaml configuration file.
|
|
template:
|
|
dest: "{{ nodepool_template_nodepool_yaml_dest }}"
|
|
src: "{{ nodepool_template_nodepool_yaml_src }}"
|
|
|
|
- name: Copy logging configuration file.
|
|
copy:
|
|
dest: "{{ nodepool_config_log_config }}"
|
|
src: "{{ nodepool_file_logging_conf }}"
|
|
|
|
- name: Create nodepool elements directory.
|
|
file:
|
|
group: "{{ ansible_ssh_user }}"
|
|
mode: 0775
|
|
owner: "{{ ansible_ssh_user }}"
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- "{{ nodepool_elements_dir_dest }}"
|
|
|
|
- name: Rsync nodepool elements directory.
|
|
sudo: no
|
|
synchronize:
|
|
dest: "{{ nodepool_elements_dir_dest }}"
|
|
perms: yes
|
|
rsync_opts:
|
|
- '--delete'
|
|
src: "{{ nodepool_elements_dir }}"
|
|
when: nodepool_elements_dir != ""
|
|
|
|
- name: Create nodepool scripts directory.
|
|
file:
|
|
group: "{{ ansible_ssh_user }}"
|
|
mode: 0775
|
|
owner: "{{ ansible_ssh_user }}"
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- "{{ nodepool_scripts_dir_dest }}"
|
|
|
|
- name: Rsync nodepool scripts directory.
|
|
sudo: no
|
|
synchronize:
|
|
dest: "{{ nodepool_scripts_dir_dest }}"
|
|
perms: yes
|
|
rsync_opts:
|
|
- '--delete'
|
|
src: "{{ nodepool_scripts_dir }}"
|
|
when: nodepool_scripts_dir != ""
|