Skip to content

Commit

Permalink
Eliminating prereq tasks for OSP roles (#604)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Barfuss <[email protected]>
  • Loading branch information
oybed and paulbarfuss authored Apr 9, 2021
1 parent cd1fd51 commit 2a729b2
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 45 deletions.
5 changes: 0 additions & 5 deletions roles/osp/admin-floating-ip/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- name: "Create the floating ip"
os_floating_ip:
cloud: "{{ item.cloud | default(osp_default_cloud) | default(omit) }}"
Expand Down
57 changes: 57 additions & 0 deletions roles/osp/admin-image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Role Name
=========

This role allow users to add or remove a images in OpenStack

Requirements
------------

1. A valid OpenStack RC file, with the proper access rights to an OpenStack tenant, needs to be sourced before using this role.
1. The `openstack` python shade packages to allow for interactions with the platform.


Role Variables
--------------

See `Example Inventory` below for more specific details. At a high level, the following variables need to be defined:

- `osp_images`: A list of images to add

Dependencies
------------

None


Example Playbook
----------------

```
- hosts: servers
roles:
- role: admin-image
```

**Note:** Make sure to source the OpenStack RC file (with proper access rights) before running this playbook/role.

Example Inventory
----------------

```
osp_images:
- filename: "/the/path/to/my/image.qcow2"
disk_format: qcow2
is_public: yes
name: my-image
```


License
-------

Apache License 2.0

Author Information
------------------

Red Hat Community of Practice & staff of the Red Hat Open Innovation Labs.
5 changes: 0 additions & 5 deletions roles/osp/admin-image/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- name: "Create the image"
os_image:
cloud: "{{ item.cloud | default(osp_default_cloud) | default(omit) }}"
Expand Down
5 changes: 0 additions & 5 deletions roles/osp/admin-instance/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- name: Manage OpenStack instance
os_server:
cloud: "{{ item.cloud | default(osp_default_cloud) | default(omit) }}"
Expand Down
5 changes: 0 additions & 5 deletions roles/osp/admin-network/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- import_tasks: "manage-networks.yml"

- import_tasks: "manage-subnets.yml"
Expand Down
63 changes: 63 additions & 0 deletions roles/osp/admin-nova-flavor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Role Name
=========

This role allow users to add nova flavors to OpenStack.

Requirements
------------

2 Requirements:

1. A valid OpenStack RC file, with the proper access rights to an OpenStack tenant, needs to be sourced before using this role.
1. The `openstack` binary, compatible with the target OpenStack environment, is accessible part of your path.


Role Variables
--------------

See `Example Inventory` below for more specific details.

The following inventory variable is required:
- `osp_custom_flavors`: A list of flavors to manage


Dependencies
------------

None


Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

```
- hosts: servers
roles:
- role: admin-nova-flavor
```

**Note:** Make sure to source the OpenStack RC file (with proper access rights) before running this playbook/role.

Example Inventory
----------------

```
osp_custom_flavors:
- name: "m1.tiny"
ram: 512
disk: 10
vcpus: 1
```


License
-------

Apache License 2.0

Author Information
------------------

Red Hat Community of Practice & staff of the Red Hat Open Innovation Labs.
5 changes: 0 additions & 5 deletions roles/osp/admin-nova-flavor/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- name: "Create the flavor"
os_nova_flavor:
cloud: "{{ item.cloud | default(osp_default_cloud) | default(omit) }}"
Expand Down
5 changes: 0 additions & 5 deletions roles/osp/admin-project/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- name: "Add projects / tenants"
os_project:
cloud: "{{ item.cloud | default(osp_default_cloud) | default(omit) }}"
Expand Down
5 changes: 0 additions & 5 deletions roles/osp/admin-sec-group/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- name: Manage Security Groups
os_security_group:
cloud: "{{ item.cloud | default(osp_default_cloud) | default(omit) }}"
Expand Down
5 changes: 0 additions & 5 deletions roles/osp/admin-user/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- name: "Create the User Accounts"
os_user:
cloud: "{{ item.cloud | default(osp_default_cloud) | default(omit) }}"
Expand Down
5 changes: 0 additions & 5 deletions roles/osp/admin-volume/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---

- name: "Install prereq software"
package:
name: 'python2-shade'
state: present

- name: "Manage Volumes"
os_volume:
cloud: "{{ item.cloud | default(osp_default_cloud) | default(omit) }}"
Expand Down

0 comments on commit 2a729b2

Please sign in to comment.