First pass for configuration
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
5680e6e07d
commit
a97239472a
|
@ -3,6 +3,7 @@
|
||||||
nodepool_config_elements_dir: /etc/nodepool/elements
|
nodepool_config_elements_dir: /etc/nodepool/elements
|
||||||
nodepool_config_images_dir: /opt/nodepool/images
|
nodepool_config_images_dir: /opt/nodepool/images
|
||||||
nodepool_config_script_dir: /etc/nodepool/scripts
|
nodepool_config_script_dir: /etc/nodepool/scripts
|
||||||
|
nodepool_config_zmq_publishers: []
|
||||||
|
|
||||||
# tasks/install.yaml
|
# tasks/install.yaml
|
||||||
nodepool_git_dest: /opt/git/openstack-infra/nodepool
|
nodepool_git_dest: /opt/git/openstack-infra/nodepool
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Nodepool Service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=nodepool
|
||||||
|
Group=nodepool
|
||||||
|
EnvironmentFile=-/etc/sysconfig/nodepool
|
||||||
|
ExecStart=/usr/bin/nodepoold -d
|
||||||
|
|
||||||
|
StandardOutput=syslog
|
||||||
|
StandardError=syslog
|
|
@ -0,0 +1,2 @@
|
||||||
|
nodepool ALL=(ALL) NOPASSWD:ALL
|
||||||
|
Defaults:nodepool !requiretty
|
|
@ -0,0 +1 @@
|
||||||
|
DIB_IMAGE_CACHE=/opt/nodepool/cache
|
|
@ -1,5 +1,29 @@
|
||||||
---
|
---
|
||||||
|
- name: Create system user account.
|
||||||
|
user:
|
||||||
|
createhome: yes
|
||||||
|
home: /var/lib/nodepool
|
||||||
|
name: nodepool
|
||||||
|
|
||||||
|
- name: Create required directories.
|
||||||
|
file:
|
||||||
|
group: nodepool
|
||||||
|
owner: nodepool
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- /etc/nodepool
|
||||||
|
- "{{ nodepool_config_images_dir }}"
|
||||||
|
- /var/lib/nodepool
|
||||||
|
- /var/log/nodepool
|
||||||
|
|
||||||
- name: Template nodepool configuration file.
|
- name: Template nodepool configuration file.
|
||||||
template:
|
template:
|
||||||
dest: /etc/nodepool/nodepool.yaml
|
dest: /etc/nodepool/nodepool.yaml
|
||||||
src: nodepool.yaml.j2
|
src: nodepool.yaml.j2
|
||||||
|
|
||||||
|
- name: Copy sudoers file into place.
|
||||||
|
copy:
|
||||||
|
dest: /etc/sudoers.d/nodepool
|
||||||
|
src: nodepool.sudoers
|
||||||
|
validate: 'visudo -cf %s'
|
||||||
|
|
|
@ -20,8 +20,3 @@
|
||||||
|
|
||||||
- include: install/pip.yaml
|
- include: install/pip.yaml
|
||||||
when: nodepool_install_method == 'pip'
|
when: nodepool_install_method == 'pip'
|
||||||
|
|
||||||
- name: Create nodepool directory.
|
|
||||||
file:
|
|
||||||
path: /etc/nodepool
|
|
||||||
state: directory
|
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
- name: Include OS-specific variables.
|
- name: Include OS-specific variables.
|
||||||
include_vars: "{{ ansible_os_family }}.yaml"
|
include_vars: "{{ ansible_os_family }}.yaml"
|
||||||
|
|
||||||
|
- name: Include nodepool configuration defaults.
|
||||||
|
include_vars: nodepool.yaml
|
||||||
|
|
||||||
- include: install.yaml
|
- include: install.yaml
|
||||||
|
|
||||||
- include: config.yaml
|
- include: config.yaml
|
||||||
|
|
|
@ -1 +1,16 @@
|
||||||
---
|
---
|
||||||
|
- name: Copy systemd file into place.
|
||||||
|
copy:
|
||||||
|
dest: /etc/systemd/system
|
||||||
|
src: nodepool.service
|
||||||
|
|
||||||
|
- name: Copy sysconfig file into place.
|
||||||
|
copy:
|
||||||
|
dest: /etc/sysconfig/nodepool
|
||||||
|
src: nodepool.sysconfig
|
||||||
|
|
||||||
|
- name: Enable nodepool service.
|
||||||
|
service:
|
||||||
|
enabled: yes
|
||||||
|
name: nodepool
|
||||||
|
state: started
|
||||||
|
|
|
@ -2,4 +2,18 @@ elements-dir: {{ nodepool_config_elements_dir }}
|
||||||
images-dir: {{nodepool_config_images_dir }}
|
images-dir: {{nodepool_config_images_dir }}
|
||||||
script-dir: {{ nodepool_config_script_dir }}
|
script-dir: {{ nodepool_config_script_dir }}
|
||||||
|
|
||||||
|
# TODO(pabelanger): Remove hardcoded variable.
|
||||||
|
dburi: sqlite:////var/lib/nodepool/nodepool.db
|
||||||
|
|
||||||
|
{% set _zmq_publishers = { 'zmq-publishers': nodepool_config_zmq_publishers } -%}
|
||||||
|
{{ _zmq_publishers | to_nice_yaml }}
|
||||||
|
{% set _diskimages = { 'diskimages': diskimages } -%}
|
||||||
|
{{ _diskimages | to_nice_yaml }}
|
||||||
|
{% set _labels = { 'labels': labels } -%}
|
||||||
|
{{ _labels | to_nice_yaml }}
|
||||||
|
{% set _providers = { 'providers': providers } -%}
|
||||||
|
{{ _providers | to_nice_yaml }}
|
||||||
|
{% set _targets = { 'targets': targets } -%}
|
||||||
|
{{ _targets | to_nice_yaml }}
|
||||||
|
|
||||||
# {{ ansible_managed }}
|
# {{ ansible_managed }}
|
||||||
|
|
|
@ -19,7 +19,6 @@ diskimages:
|
||||||
elements:
|
elements:
|
||||||
- centos
|
- centos
|
||||||
- vm
|
- vm
|
||||||
release: trusty
|
|
||||||
- name: ubuntu-trusty
|
- name: ubuntu-trusty
|
||||||
elements:
|
elements:
|
||||||
- ubuntu
|
- ubuntu
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
diskimages: []
|
||||||
|
labels: []
|
||||||
|
providers: []
|
||||||
|
targets: []
|
Loading…
Reference in New Issue