Initial commit

This commit is contained in:
Ricardo Carrillo Cruz 2015-03-27 09:47:58 +01:00
commit 150f550d89
13 changed files with 117 additions and 0 deletions

0
gerrit.yml Normal file
View File

2
hosts Normal file
View File

@ -0,0 +1,2 @@
[local]
127.0.0.1

27
instances_config.yml Normal file
View 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
View File

0
nodepool.yml Normal file
View File

6
provision.yml Normal file
View File

@ -0,0 +1,6 @@
---
# file: provision.yml
- hosts: localhost
connection: local
roles:
- { role: create_openstack_instances }

9
puppetdb.yml Normal file
View 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
View File

View 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

View 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'

View 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'] }}" }'

View 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

8
site.yml Normal file
View File

@ -0,0 +1,8 @@
---
# file: site.yml
- include: provision
- include: puppetdb
- include: puppetmaster
- include: jenkins
- include: gerrit
- include: nodepool