-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a ReadMe file for provisioning OpenStack made changes to the files adding quotes changed the readme extension deleted extra spaces changed README name adding updated playbook and README made changes to README and playbook Edited Readme
- Loading branch information
Likhitha Eda
committed
Aug 3, 2020
1 parent
6e60b93
commit 24e4f34
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Automate Provisioning OpenStack Instance | ||
|
||
- The Ansible playbook will automate the creation of an openstack instance. | ||
- The playbook contains the neccessary parameters to create the instance. | ||
- The parameters include: image, key_name, flavor, network, and security_groups | ||
- The parameters image, flavor, network, and security groups must be passed in the command line as extra-vars when running the playbook. | ||
|
||
### Steps to Create the OS Instance | ||
1. Run the following commands to set up the OpenStack credentials: | ||
**export OS_AUTH_URL= < url-to-openstack-identity > #you can get this url from OS VM | ||
export OS_PROJECT_NAME= < project-name > | ||
export OS_USER_DOMAIN_NAME= < domain-name > *# (optional)* | ||
export OS_PROJECT_DOMAIN_ID= < domain-ID > *# (optional)* | ||
export OS_USERNAME= < user-name > | ||
export OS_PASSWORD= < password > # *(optional)*** | ||
|
||
2. Run the playbook with the following command and provide the parameters as extra-vars: | ||
**ansible-playbook -vv -i "localhost," --connection=local provision_openstack_instance.yml -e "vm_name=< give a name for the VM > image=< image name > flavor=< flavor name > network=< network name > sec_groups= < security groups name >"** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
- name: "Provision Open Stack Instance" | ||
hosts: '{{ hosts | default("all") }}' | ||
become: '{{ become | default("no") }}' | ||
gather_facts: '{{ gather_facts | default("no") }}' | ||
tasks: | ||
|
||
- name: "provision a key pair" | ||
os_keypair: | ||
state: present | ||
name: ansible_key | ||
register: keypair_output | ||
|
||
- name: "copy the keypair_output to a file" | ||
copy: | ||
content: keypair_output["private_key"] | ||
dest: "~/.ssh/keypair_output.pem" | ||
|
||
- name: "Create a new OpenShift instance on Virtual Machine" | ||
os_server: | ||
state: present | ||
name: "{{ vm_name }}" | ||
image: "{{ image }}" | ||
key_name: ansible_key | ||
flavor: "{{ flavor }}" | ||
network: "{{ network }}" | ||
security_groups: "{{ sec_groups }}" |