Skip to content

Commit

Permalink
use VM init playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdotcosta committed Oct 31, 2023
1 parent bc9a87c commit 7be29bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
14 changes: 5 additions & 9 deletions ansible/playbook/openstack/openstack_vm_create_passwordstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@
- "DON'T FORGET TO SECURE YOUR SERVER!!!"
- ""
- "Trying to start start server securization automatically."
- "For manual execution: $ ansible-playbook ansible/playbook/sec_host.yml -e vm_name={{ vm_name }} -e provider=openstack"
- ""
- "For manual execution:"
- "$ ansible-playbook ansible/playbook/openstack/openstack_vm_init.yml -e vm_name={{ vm_name }}"
- "$ ansible-playbook ansible/playbook/sec_host.yml -e vm_name={{ vm_name }} -e provider=openstack"

- name: "Add to known hosts"
hosts: localhost
Expand All @@ -113,14 +116,7 @@
when: skip_post_installation is undefined or not skip_post_installation

- name: "Openstack VM init"
hosts: "{{ vm_name | default([]) }}"
gather_facts: "{{ vm_name is defined and (not skip_post_installation is defined or not skip_post_installation) }}"

tasks:
- name: Init RHOS VM
ansible.builtin.include_role:
name: "openstack/init_vm"
when: skip_post_installation is undefined or not skip_post_installation
ansible.builtin.import_playbook: "openstack_vm_init.yml"

- name: "Secure new server"
ansible.builtin.import_playbook: "../sec_host.yml"
Expand Down
15 changes: 8 additions & 7 deletions ansible/playbook/openstack/openstack_vm_init.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---

- name: "Openstack VM init"
hosts: "{{ vm_name }}"
gather_facts: yes
hosts: "{{ vm_name | default([]) }}"
gather_facts: "{{ vm_name is defined and (not skip_post_installation is defined or not skip_post_installation) }}"

roles:
- role: "openstack/init_vm"
vars:
state: "present"
...
tasks:
- name: Init RHOS VM
ansible.builtin.include_role:
name: "openstack/init_vm"

...

0 comments on commit 7be29bb

Please sign in to comment.