Skip to content

Commit

Permalink
drop helper_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn committed Sep 30, 2024
1 parent fe23ffa commit 7dcf4bb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 37 deletions.
1 change: 0 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ skip_list:
- name[template] # Allow Jinja templating inside task and play names
exclude_paths:
- molecule/
- roles/helper_module/
16 changes: 12 additions & 4 deletions molecule/identity/converge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
---
- name: Run the playbook
ansible.builtin.import_playbook: ../../playbooks/acs.yml
vars:
autogen_unsecure_secrets: true
- name: Check if current OS version is in the supported matrix
hosts: all
gather_facts: false
tasks:
- name: Listen to port
ansible.builtin.command: "nc -l 8000"
async: 10
poll: 0
- name: Wait for port
ansible.builtin.wait_for:
port: 8000
state: started
File renamed without changes.
File renamed without changes.
50 changes: 18 additions & 32 deletions playbooks/prerun-network-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@
- name: Run preliminary network checks for repository hosts
hosts: repository
become: true
roles:
- role: '../roles/helper_modules'
tasks:
- name: Check db connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.database | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.database[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.postgres.sql }}"
delegate_target: "{{ groups.database | first }}"
when: repo_db_url == ""

- name: Check activemq connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.activemq | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.activemq[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.activemq[activemq_protocol] }}"
delegate_target: "{{ groups.activemq | first }}"
when: groups.activemq | default([]) | length > 0

- name: Check search connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.search | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.search[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.search.http }}"
delegate_target: "{{ groups.search | first }}"
when: groups.search | default([]) | length > 0

- name: Check sync connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.syncservice | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.syncservice[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.sync.http }}"
Expand All @@ -40,23 +38,23 @@
- acs.edition == "Enterprise"

- name: Check sfs connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.transformers | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.transformers[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.sfs.http }}"
delegate_target: "{{ groups.transformers | first }}"
when: acs.edition == "Enterprise"

- name: Check trouter connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.transformers | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.transformers[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.transformers.trouter }}"
delegate_target: "{{ groups.transformers | first }}"
when: acs.edition == "Enterprise"

- name: Check tengine connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.transformers | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.transformers[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.transformers.tengine }}"
Expand All @@ -65,11 +63,9 @@
- name: Run preliminary network checks for search hosts
hosts: search
become: true
roles:
- role: '../roles/helper_modules'
tasks:
- name: Check repo connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.repository | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.repository[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.repository.http }}"
Expand All @@ -78,11 +74,9 @@
- name: Run preliminary network checks for transformers hosts
hosts: transformers
become: true
roles:
- role: '../roles/helper_modules'
tasks:
- name: Check activemq connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.activemq | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.activemq[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.activemq[activemq_protocol] }}"
Expand All @@ -92,26 +86,24 @@
- name: Run preliminary network checks for syncservice hosts
hosts: syncservice
become: true
roles:
- role: '../roles/helper_modules'
tasks:
- name: Check db connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.database | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.database[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.postgres.sql }}"
delegate_target: "{{ groups.database | first }}"
when: repo_db_url == ""

- name: Check repo connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.repository | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.repository[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.repository.http }}"
delegate_target: "{{ groups.repository | first }}"

- name: Check activemq connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.activemq | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.activemq[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.activemq[activemq_protocol] }}"
Expand All @@ -121,11 +113,9 @@
- name: Run preliminary network checks for acc hosts
hosts: acc
become: true
roles:
- role: '../roles/helper_modules'
tasks:
- name: Check repo connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.repository | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.repository[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.repository.http }}"
Expand All @@ -134,11 +124,9 @@
- name: Run preliminary network checks for adw hosts
hosts: adw
become: true
roles:
- role: '../roles/helper_modules'
tasks:
- name: Check repo connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.repository | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.repository[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.repository.http }}"
Expand All @@ -147,18 +135,16 @@
- name: Run preliminary network checks for nginx hosts
hosts: nginx
become: true
roles:
- role: '../roles/helper_modules'
tasks:
- name: Check repo connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.repository | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.repository[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.repository.http }}"
delegate_target: "{{ groups.repository | first }}"

- name: Check sync connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.syncservice | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.syncservice[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.sync.http }}"
Expand All @@ -168,7 +154,7 @@
- acs.edition == "Enterprise"

- name: Check acc connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.acc | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.acc[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.acc.http }}"
Expand All @@ -178,7 +164,7 @@
- acs.edition == "Enterprise"

- name: Check adw connection
ansible.builtin.include_tasks: "../roles/helper_modules/tasks/check_port.yml"
ansible.builtin.include_tasks: "check_port.yml"
vars:
checked_host: "{% if groups.adw | length == 0 %}127.0.0.1{% else %}{{ hostvars[groups.adw[0]].ansible_host | default('127.0.0.1') }}{% endif %}"
checked_port: "{{ ports_cfg.adw.http }}"
Expand Down

0 comments on commit 7dcf4bb

Please sign in to comment.