Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
okozachenko1203 committed Jan 16, 2024
1 parent 0774761 commit c639603
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 40 deletions.
1 change: 0 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exclude_paths:
- playbooks
- roles/defaults/vars/main.yml
- roles/kube_prometheus_stack/files/jsonnet
- roles/secretgen_controller/tasks/main.yml
- vendir.lock.yml

warn_list:
Expand Down
76 changes: 38 additions & 38 deletions roles/octavia/tasks/generate_resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,42 +153,42 @@
image: "{{ octavia_amphora_image_name }}"
register: _octavia_amphora_image

- name: Deploy Amphora jumpbox
- name: Create amphora ssh key
run_once: true
block:
- name: Create amphora ssh key
kubernetes.core.k8s:
state: present
definition:
apiVersion: secretgen.k14s.io/v1alpha1
kind: SSHKey
metadata:
name: octavia-amphora-ssh-key
namespace: openstack
spec:
secretTemplate:
type: Opaque
stringData:
"id_rsa": $(privateKey)
"id_rsa.pub": $(authorizedKey)
wait: true
wait_timeout: 60
wait_condition:
type: ReconcileSucceeded
status: true

- name: Grab Amphora jumpbox public key
kubernetes.core.k8s_info:
api_version: v1
kind: Secret
name: octavia-amphora-ssh-key
namespace: openstack
register: _octavia_ssh_key_secret

- name: Create Amphora ssh key pair in Openstack
openstack.cloud.keypair:
cloud: atmosphere
state: present
name: octavia-amphora-ssh-key
public_key: "{{ _octavia_ssh_key_secret.resources[0]['data']['id_rsa.pub'] | b64decode }}"
register: _octavia_amphora_ssh_keypair
kubernetes.core.k8s:
state: present
definition:
apiVersion: secretgen.k14s.io/v1alpha1
kind: SSHKey
metadata:
name: "{{ octavia_helm_release_name }}-amphora-ssh-key"
namespace: "{{ octavia_helm_release_namespace }}"
spec:
secretTemplate:
type: Opaque
stringData:
"id_rsa": $(privateKey)
"id_rsa.pub": $(authorizedKey)
wait: true
wait_timeout: 60
wait_condition:
type: ReconcileSucceeded
status: true

- name: Grab Amphora jumpbox public key
run_once: true
kubernetes.core.k8s_info:
api_version: v1
kind: Secret
name: "{{ octavia_helm_release_name }}-amphora-ssh-key"
namespace: "{{ octavia_helm_release_namespace }}"
register: _octavia_ssh_key_secret

- name: Create Amphora ssh key pair in Openstack
run_once: true
openstack.cloud.keypair:
cloud: atmosphere
state: present
name: "{{ octavia_helm_release_name }}-amphora-ssh-key"
public_key: "{{ _octavia_ssh_key_secret.resources[0]['data']['id_rsa.pub'] | b64decode }}"
register: _octavia_amphora_ssh_keypair
2 changes: 1 addition & 1 deletion roles/octavia/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ _octavia_helm_values:
secretName: octavia-client-certs
- name: octavia-amphora-ssh-key
secret:
secretName: octavia-amphora-ssh-key
secretName: "{{ octavia_helm_release_name }}-amphora-ssh-key"
defaultMode: 0444 # noqa: yaml[octal-values]
- name: octavia-amphora-ssh-key-dir
emptyDir: {}
Expand Down

0 comments on commit c639603

Please sign in to comment.