Initial commit
This commit is contained in:
commit
150f550d89
0
gerrit.yml
Normal file
0
gerrit.yml
Normal file
27
instances_config.yml
Normal file
27
instances_config.yml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
instances_config:
|
||||||
|
- name: puppetdb.infra.test.rcarrillocruz.cloud
|
||||||
|
image: 9d25fe2d-cf31-4b05-8c58-f238ec78e633
|
||||||
|
flavor: standard.small
|
||||||
|
net_name: infra-test-network
|
||||||
|
node_type: puppetdb
|
||||||
|
- name: puppetmaster.infra.test.rcarrillocruz.cloud
|
||||||
|
image: 9d25fe2d-cf31-4b05-8c58-f238ec78e633
|
||||||
|
flavor: standard.small
|
||||||
|
net_name: infra-test-network
|
||||||
|
node_type: puppetmaster
|
||||||
|
- name: jenkins.infra.test.rcarrillocruz.cloud
|
||||||
|
image: 9d25fe2d-cf31-4b05-8c58-f238ec78e633
|
||||||
|
flavor: standard.small
|
||||||
|
net_name: infra-test-network
|
||||||
|
node_type: jenkins
|
||||||
|
- name: gerrit.infra.test.rcarrillocruz.cloud
|
||||||
|
image: 9d25fe2d-cf31-4b05-8c58-f238ec78e633
|
||||||
|
flavor: standard.small
|
||||||
|
net_name: infra-test-network
|
||||||
|
node_type: gerrit
|
||||||
|
- name: nodepool.infra.test.rcarrillocruz.cloud
|
||||||
|
image: 9d25fe2d-cf31-4b05-8c58-f238ec78e633
|
||||||
|
flavor: standard.small
|
||||||
|
net_name: infra-test-network
|
||||||
|
node_type: nodepool
|
0
jenkins.yml
Normal file
0
jenkins.yml
Normal file
0
nodepool.yml
Normal file
0
nodepool.yml
Normal file
6
provision.yml
Normal file
6
provision.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
# file: provision.yml
|
||||||
|
- hosts: localhost
|
||||||
|
connection: local
|
||||||
|
roles:
|
||||||
|
- { role: create_openstack_instances }
|
9
puppetdb.yml
Normal file
9
puppetdb.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
# file: puppetdb.yml
|
||||||
|
|
||||||
|
- hosts: puppetdb
|
||||||
|
user: ubuntu
|
||||||
|
sudo: yes
|
||||||
|
roles:
|
||||||
|
- { role: common }
|
||||||
|
- { role: configure_puppetdb }
|
0
puppetmaster.yml
Normal file
0
puppetmaster.yml
Normal file
31
roles/common/tasks/main.yml
Normal file
31
roles/common/tasks/main.yml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
# Set hostname and /etc/hosts
|
||||||
|
# (Taken from https://github.com/ansible/ansible/pull/8482)
|
||||||
|
- set_fact: full_hostname="{{ inventory_hostname}}"
|
||||||
|
short_hostname="{{ inventory_hostname.split('.', 1)[0] }}"
|
||||||
|
|
||||||
|
# " lovely lonely double-quote for fixing vim highlighting
|
||||||
|
|
||||||
|
- hostname: name={{ short_hostname }}
|
||||||
|
|
||||||
|
- name: add hostname to /etc/hosts
|
||||||
|
lineinfile: dest=/etc/hosts
|
||||||
|
line='{{ hostvars[inventory_hostname]['openstack']['private_v4']}} {{ full_hostname }} {{ short_hostname }}'
|
||||||
|
insertafter='^127\.0\.0\.1'
|
||||||
|
state=present
|
||||||
|
|
||||||
|
# Update packages
|
||||||
|
- apt: update_cache=yes
|
||||||
|
|
||||||
|
# Install git
|
||||||
|
- apt: name=git
|
||||||
|
|
||||||
|
# Clone system-config
|
||||||
|
- git: repo=https://git.openstack.org/openstack-infra/system-config
|
||||||
|
dest=/opt/git/system-config
|
||||||
|
|
||||||
|
# Install puppet
|
||||||
|
- command: bash /opt/git/system-config/install_puppet.sh
|
||||||
|
|
||||||
|
# Install puppet modules
|
||||||
|
- command: bash /opt/git/system-config/install_modules.sh
|
3
roles/configure_puppetdb/tasks/main.yml
Normal file
3
roles/configure_puppetdb/tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
# Puppet apply the puppetdb manifest
|
||||||
|
- command: puppet apply --modulepath='/opt/git/system-config/modules:/etc/puppet/modules' -e 'include openstack_project::puppetdb'
|
12
roles/configure_puppetmaster/tasks/main.yml
Normal file
12
roles/configure_puppetmaster/tasks/main.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
# Install puppetmaster packages
|
||||||
|
- apt: name={{ item }} state=installed
|
||||||
|
with_items:
|
||||||
|
- puppetmaster-passenger
|
||||||
|
- hiera
|
||||||
|
- hiera-puppet
|
||||||
|
|
||||||
|
# Puppet apply the puppetmaster manifest
|
||||||
|
- command: >
|
||||||
|
puppet apply --modulepath='/opt/git/system-config/modules:/etc/puppet/modules'
|
||||||
|
-e 'class {"openstack_project::puppetmaster"':' puppetdb_server => "{{ hostvars[groups['puppetdb'][0]]['openstack']['name'] }}" }'
|
19
roles/create_openstack_instances/tasks/main.yml
Normal file
19
roles/create_openstack_instances/tasks/main.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
- name: Create OpenStack instances
|
||||||
|
os_server:
|
||||||
|
state: present
|
||||||
|
cloud: openstack
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
region_name: region-b.geo-1
|
||||||
|
availability_zone: az2
|
||||||
|
image: "{{ item.image }}"
|
||||||
|
key_name: workstation
|
||||||
|
timeout: 200
|
||||||
|
flavor: "{{ item.flavor }}"
|
||||||
|
nics:
|
||||||
|
- net-name: "{{ item.net_name }}"
|
||||||
|
security_groups: default
|
||||||
|
auto_floating_ip: yes
|
||||||
|
meta:
|
||||||
|
group: infra
|
||||||
|
node_type: "{{ item.node_type }}"
|
||||||
|
with_items: instances_config
|
Loading…
Reference in New Issue
Block a user