Commit 070e9721 authored by Daniel Buøy-Vehn's avatar Daniel Buøy-Vehn

Update ansible code

parent 958decd0
---
openstack_instance:
os_auth:
auth_url: 'https://iaas.redpill-linpro.com/api/identity/v3'
username: 'dbv'
password: !vault |
$ANSIBLE_VAULT;1.1;AES256
32363937393466366130323330353061333333626239643535666465366430336130346337376239
3363613861623539363763346133623036373163653266330a366635336262383430626464363864
34366534613933346631636163333037363235373633643933336335643663653934326331663666
3037616434643034340a633964316166353533643666396438353666353331353234303839383132
3337
project_name: 'users.dbv'
domain_name: 'redpill-linpro'
network:
ip_version: '4'
cidr: 10.0.0.0/24
network_name: rl_conference_demo
os_host_name: 'vm01.example.com'
os_host_flavor: '15002000'
os_host_image: '2f9af77a-f5b3-4373-bb9c-6e4cb56998d9'
os_host_keyname: 'ctad_demo_client_access'
os_host_securitygroups:
- 'ssh incoming'
- 'default'
naming_service_url: 'http://docker01.example.com:5000/hostgen/api/v1.0/generate'
os_host_inventory: openstack_hosts
../group_vars/
\ No newline at end of file
......@@ -3,48 +3,20 @@
become: no
gather_facts: no
vars:
os_auth:
auth_url: 'https://iaas.redpill-linpro.com/api/identity/v3'
username: 'dbv'
password: "{{ os_password }}"
project_name: 'users.dbv'
domain_name: 'redpill-linpro'
os_network:
ip_version: '4'
cidr: 10.0.0.0/24
network_name: "{{ os_host_network }}"
os_auth: "{{ openstack_instance.os_auth }}"
os_host_network: "{{ openstack_instance.network.network_name }}"
tasks:
- name: RUN ALL COMMANDS AGAINST LOCALHOST
block:
- name: "CREATE NETWORK IN OPENSTACK [ {{ os_host_network }} ]"
os_network:
state: present
admin_state_up: Yes
auth: "{{ os_auth }}"
name: "{{ os_host_network }}"
tags: network
- name: "CREATE SUBNET IN OPENSTACK [ {{ os_host_subnet }} ]"
os_subnet:
state: present
auth: "{{ os_auth }}"
name: "{{ os_host_subnet }}"
enable_dhcp: True
ip_version: "{{ os_network.ip_version }}"
network_name: "{{ os_network.network_name }}"
cidr: "{{ os_network.cidr }}"
tags: network
# - name: FETCH HOSTNAME FROM SERVICE
# uri:
# url: "{{ naming_service_url }}"
# method: 'POST'
# register: hostname
# - name: DEBUG
# debug:
# msg: "{{ hostname }}"
- name: "CREATE ROUTER IN NETWORK [ {{ os_network_router }}]"
os_router:
name: "{{ os_network_router.name }}"
state: "{{ os_network_router.state | default('present') }}"
auth: "{{ os_auth }}"
admin_state_up: "{{ os_network_router.admin_state_up | default(True) }}"
network: "{{ os_network_router.network }}"
interfaces: "{{ os_network_router.interfaces | default(omit) }}"
tags: router
- name: "CREATE MACHINE IN OPENSTACK [ {{ os_host_name }} ]"
os_server:
......@@ -53,31 +25,18 @@
name: "{{ os_host_name }}"
image: "{{ os_host_image }}"
flavor: "{{ os_host_flavor }}"
reuse_ips: True
floating_ip_pools: 'Internet (osl2)'
security_groups: "{{ os_host_securitygroups | default(omit) }}"
key_name: "{{ os_host_keyname }}"
timeout: "{{ os_host_timeout | default(100) }}"
auto_ip: False
userdata: |
system_info:
default_user:
name: ansible
sudo: ALL=(ALL) NOPASSWD:ALL
nics:
- net-name: 'rl_conference_demo'
tags: host
- name: "CREATE MACHINE IN OPENSTACK [ docker01.example.com ]"
os_server:
state: present
auth: "{{ os_auth }}"
name: docker01.example.com
image: "{{ os_host_image }}"
flavor: "{{ os_host_flavor }}"
reuse_ips: True
floating_ip_pools: 'Internet (osl2)'
security_groups: "ssh incoming"
key_name: "{{ os_host_keyname }}"
timeout: "{{ os_host_timeout | default(100) }}"
nics:
- net-name: 'rl_conference_demo'
tags: host
delegate_to: localhost
../roles/
\ No newline at end of file
---
_tower_config:
host: https://localhost
username: admin
password: toweradmin
verify_ssl: true
format: json
awx_venv: /var/lib/awx/venv/awx
ansible_venv: /var/lib/awx/venv/ansible
_tower_config_organization:
users: []
teams: []
projects: []
permissions: []
inventories: []
credentials: []
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment