Commit 78d402c6 authored by Daniel Buøy-Vehn's avatar Daniel Buøy-Vehn

Upd

parent 66e3eb33
......@@ -169,3 +169,9 @@ tower:
``` bash
$ ansible-playbook -i rl_inventory.yml playbooks/rl_ansible_tower_server.yml
```
## TBD
* [ ] Create the OpenStack environment with an Ansible Playbook
* [ ] Handle the OpenStack secrest in an Ansible Vault
* [ ] Make use of a service user.
* [ ] Write a process for creating a custom instance in any other project
#!/usr/bin/ansible-playbook --ask-vault-pass
---
# Playbook to create hosts in OpenStack
- hosts: all
become: no
gather_facts: no
vars:
os_auth: "{{ openstack_instance.os_auth }}"
os_host_network: "{{ openstack_instance.network.network_name }}"
tasks:
- name: RUN ALL COMMANDS AGAINST LOCALHOST
block:
- name: "CREATE MACHINE IN OPENSTACK [ {{ os_host_name }} ]"
os_server:
state: present
auth: "{{ os_auth }}"
name: "{{ item }}"
image: "{{ os_host_image }}"
flavor: "{{ os_host_flavor }}"
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'
loop: "{{ lookup('list', os_host_name) }}"
when: os_host_name is defined
delegate_to: localhost
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