Last active
December 30, 2022 10:00
-
-
Save sayan3296/1939f409be9a28aca524b368511ccb55 to your computer and use it in GitHub Desktop.
Error with STOMP client and port 61613 for candlepin
This file contains hidden or 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
Requirements: | |
* Satellite 6.10 ( latest minor release ) installed on RHEL 7 | |
* Organization RedHat and Location GSS | |
Breakfix Playbook: | |
~~~ | |
--- | |
- name: Creating breakfix for candlepin_events failure in Satellite 6.10 | |
hosts: repro_satellite ## mention the IP of the satellite here | |
gather_facts: true | |
tasks: | |
- name: Check the presence of ssl-build directory. | |
stat: | |
path: "/root/ssl-build" | |
register: ssl_build | |
- name: Create the ssl-build directory is it was not present. | |
file: | |
path: /root/ssl-build | |
state: directory | |
mode: '0755' | |
when: ssl_build is defined and not ssl_build.stat.exists | |
- name: Run installer to generate certs into ssl-build directory. | |
command: bash -c "satellite-installer -S satellite" | |
when: ssl_build is defined and not ssl_build.stat.exists | |
- name: Read the /etc/tomcat/cert-users.properties file | |
command: bash -c "cat /etc/tomcat/cert-users.properties" | |
register: tomcat_properties | |
- name: Decide if the file content requires modification or not. | |
set_fact: | |
need_update_answers: >- | |
{%- if tomcat_properties.stdout == 'katelloUser=CN=localhost, OU=, O=candlepin, ST=, C=IN' -%}false | |
{%- else -%}true | |
{%- endif -%} | |
- name: Modify the satellite-answers file. | |
lineinfile: | |
path: /etc/foreman-installer/scenarios.d/satellite-answers.yaml | |
regexp: "{{ item.source }}" | |
line: "{{ item.replace }}" | |
loop: | |
- { source: "^ country: US", replace: " country: IN" } | |
- { source: "^ org: Katello", replace: " org: RedHat" } | |
- { source: "^ org_unit: SomeOrgUnit", replace: " org_unit: ''" } | |
- { source: "^ state: North Carolina", replace: " state: ''" } | |
register: answers_updated | |
when: need_update_answers is defined and need_update_answers is true | |
- name: Run installer to break the system. | |
command: > | |
satellite-installer -S satellite | |
--certs-regenerate true --certs-update-all | |
--certs-update-server --certs-update-server-ca | |
register: installer_run | |
when: need_update_answers is defined and need_update_answers is true | |
- name: Stop tomcat and foreman services | |
systemd: | |
name: "{{ item }}" | |
state: stopped | |
loop: | |
- tomcat | |
- foreman.service | |
register: stop_services | |
when: need_update_answers is defined or installer_run is defined | |
- name: Break port settings for candlepin inside selinux | |
seport: | |
ports: 61613 | |
proto: tcp | |
setype: "{{ item.type }}" | |
state: "{{ item.state }}" | |
loop: | |
- { type: "candlepin_activemq_port_t", state: "absent" } | |
- { type: "foreman_proxy_port_t", state: "present" } | |
register: break_candlepin_port | |
when: stop_services is defined and stop_services is success and need_update_answers is defined | |
- name: Start back the services. | |
systemd: | |
name: "{{ item }}" | |
state: started | |
loop: | |
- tomcat | |
- foreman.service | |
register: start_services | |
when: break_candlepin_port is defined | |
- name: Confirm that the candlepin component is broken | |
uri: | |
url: "https://{{ ansible_fqdn }}/katello/api/ping" | |
return_content: yes | |
timeout: 360 | |
validate_certs: false | |
register: ping_status | |
when: start_services is defined and start_services is success | |
failed_when: '"FAIL" not in ping_status.content' | |
~~~ | |
Issue: "hammer ping" shows candlepin_auth in failed state | |
~~~ | |
candlepin_events: | |
Status: FAIL | |
message: Not running | |
Server Response: Duration: 1ms | |
~~~ | |
Task: | |
* Ensure that the "hammer ping" output shows everything is OK | |
* Executing satellite-installer command should not revert back the fixes applied i.e. satellite should remain healthy. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error message 1:
Solution 1:
Error Message 2:
Solution 2: ( improvement of this KB