Skip to content

Commit

Permalink
Update playbooks to remove login play
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiesmelfie committed Aug 16, 2024
1 parent 3e94faf commit 90c1a3e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 32 deletions.
71 changes: 39 additions & 32 deletions ci/logging_tests_local.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
---
- name: Prepare Logging Tests
hosts: controller
gather_facts: false
ignore_errors: true
vars:
id_rsa_path: "{{ playbook_dir }}/id_rsa.ctlplane"
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"

tasks:
- name: "Log into OCP"
ansible.builtin.shell:
cmd: |
oc login -u kubeadmin -p "12345678" https://api.crc.testing:6443
failed_when: false
changed_when: false

- name: "Create id rsa file for ctlplane access"
ansible.builtin.shell:
cmd: |
oc extract -n openstack secrets/dataplane-ansible-ssh-private-key-secret --to=- | grep -v "ssh\-rsa" > "{{ id_rsa_path }}"
register: rsa_results
failed_when: rsa_results.rc != 0
changed_when: false

- name: "Change files permissions"
ansible.builtin.shell:
cmd: |
chmod 600 "{{ id_rsa_path }}"
changed_when: false
#- name: Prepare Logging Tests
# hosts: controller
# gather_facts: true
# ignore_errors: false
# vars:
# id_rsa_path: "{{ playbook_dir }}/id_rsa.ctlplane"
# environment:
# KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
# PATH: "{{ cifmw_path }}"
#
# tasks:
# # This needs to be updated; what do we use elsewhere?
# # Elsewhere, we assume that we're already logged in
# - name: "Log into OCP"
# ansible.builtin.shell:
# cmd: |
# oc login -u kubeadmin -p "12345678" https://api.crc.testing:6443
# failed_when: false
# changed_when: false
#
# # I don't think we need this, Zuul __should__ have taken care of this already
# - name: "Create id rsa file for ctlplane access"
# ansible.builtin.shell:
# cmd: |
# oc extract -n openstack secrets/dataplane-ansible-ssh-private-key-secret --to=- | grep -v "ssh\-rsa" > "{{ id_rsa_path }}"
# register: rsa_results
# failed_when: rsa_results.rc != 0
# changed_when: false
#
# # (efoley): Once again, I don't think this is necessary; if it's not needed for zuul, because it's already done, but is needed before running this on other systems, then the README should be updated to reflect this;
# # A troubleshooting section can be added too so users can identify when they are missing these configuration steps
# - name: "Change files permissions"
# ansible.builtin.shell:
# cmd: |
# chmod 600 "{{ id_rsa_path }}"
# changed_when: false

- name: "Verify logging projects, endpoints, credentials, nodes, pods, services, manifests and subscriptions"
hosts: controller
Expand Down Expand Up @@ -146,7 +151,9 @@
- name: "Verify Pods running"
ansible.builtin.import_role:
name: common

# vars can be passed here, so we can use the same play for this and the next play.
# vars:
# - <vars from above>

- name: "Verify logging pods are running in openshift-logging"
hosts: controller
Expand Down
1 change: 1 addition & 0 deletions ci/vars-logging-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/run_playbooks_logging.yml"
# config_file: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/ansible.cfg"
# type: playbook
# pre_tests or post_tests are also options for when the FVT roles are run
post_deploy_fvt_logging_01_computes:
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/logging_tests_computes.yml"
config_file: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/ansible.cfg"
Expand Down

0 comments on commit 90c1a3e

Please sign in to comment.