Skip to content

Commit

Permalink
resolve ansible linting issues as per the last report Jan 24th
Browse files Browse the repository at this point in the history
Signed-off-by: puni4220 <[email protected]>
  • Loading branch information
puni4220 committed Jan 24, 2025
1 parent 2437a2d commit 02889b7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 53 deletions.
19 changes: 7 additions & 12 deletions ansible/roles/octavia_preconf/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
octavia_preconf
=========
## octavia_preconf

This is a role for performing the pre-requisite tasks to enable amphora provider for octavia for example creating a network and a subnet for amphorae, uploading the image to glance, creating ssh keys etc. This is mainly intended for running octavia in a k8s environment

Requirements
------------
## Requirements

These are the requirements to run this role:
1. This role needs to be run on any of the nodes which has access to the openstack public endpoints
2. This role also needs access to the k8s cluster as it tries to create "octavia-certs" secret in the openstack namespace to it needs access to kubectl utility
3. It is recommended to create a virtual environment to run this role; steps will be shared below

Creating a virtual environment
------------
## Creating a virtual environment

1. Install the required packages for creating the virutal environment with python:
```
root@saturn-c1:~# apt-get install python3-venv python3-pip
Expand All @@ -38,8 +36,7 @@ root@saturn-c1:~# source .venvs/octavia_preconf/bin/activate
```
note that the kubeconfig in this step has been copied from the master node and it should be modified accordingly

Role Variables
--------------
## Role Variables

+ The available variables can be found in the defaults/main.yml file
+ The role variables can be used to modify
Expand All @@ -49,13 +46,11 @@ Role Variables
+ Validity and other certificate parameters \
Refer to the role defaults for more detail

Dependencies
------------
## Dependencies

The role has no external dependencies; only the steps shared above for creating the virutal environment are required

Example Playbook
----------------
## Example Playbook

The role needs keystone admin credentials; they can be provided as environment variables \
This is an example playbook for running the role:
Expand Down
46 changes: 5 additions & 41 deletions ansible/roles/octavia_preconf/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,16 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker

# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)

min_ansible_version: 2.1

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99

author: Punit Shankar Kundal
description: Create the required pre-requisite resources for enabling amphora provider in Octavia
company: Rackspace Technology
license: Apache-2.0
min_ansible_version: 2.15.8
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.

dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
8 changes: 8 additions & 0 deletions ansible/roles/octavia_preconf/tasks/octavia_cert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
args:
chdir: "{{ octavia_certs_dir }}"
creates: "{{ octavia_server_ca_cert }}"
tags:
- skip_ansible_lint

- name: Generate Client CA private key
community.crypto.openssl_privatekey:
Expand All @@ -80,6 +82,8 @@
args:
chdir: "{{ octavia_certs_dir }}"
creates: "{{ octavia_client_ca_cert }}"
tags:
- skip_ansible_lint

- name: Create Client key (octavia-worker)
community.crypto.openssl_privatekey:
Expand Down Expand Up @@ -107,12 +111,16 @@
args:
chdir: "{{ octavia_certs_dir }}"
creates: "{{ octavia_client_cert }}"
tags:
- skip_ansible_lint

- name: Create a single file for client key and cert (octavia-worker)
shell:
cmd: cat "{{ octavia_client_key }}" "{{ octavia_client_cert }}" > "{{ octavia_client_key_cert }}"
chdir: "{{ octavia_certs_dir }}"
creates: "{{ octavia_client_key_cert }}"
tags:
- skip_ansible_lint

- name: Run the script to create the yaml file for octavia-certs secret
script:
Expand Down

0 comments on commit 02889b7

Please sign in to comment.