Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to hxr.admin-tools #998

Merged
merged 7 commits into from
Nov 20, 2023

Conversation

mira-miracoli
Copy link
Contributor

  1. CHANGE vars/main.yml to defaults/main.yml
  2. REMOVE disable firewalld (this is very unexpected behaviour for this role imo)
  3. CHANGE byobu is conditinally installed (no package available for EL9)

This Role is used by:

  • telescope
  • apollo
  • build
  • plausible
  • cvmfs

If we need to disable firewalld somewhere there, we should do it separately (even though I don't see a case where it is necessary or good)

@mira-miracoli mira-miracoli requested review from bgruening, sanjaysrikakulam and kysrpex and removed request for bgruening November 17, 2023 11:01
@@ -15,7 +15,7 @@ admin_packages:
- net-tools
- unzip
- mutt
- byobu
- "{{ byobu if ansible_distribution_major_version < '9' | default(omit) }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- "{{ byobu if ansible_distribution_major_version < '9' | default(omit) }}"
- "{{ 'byobu' if ansible_distribution_major_version < '9' else omit }}"

Just run this task to see why.

    - name: Debug.
      ansible.builtin.debug:
        msg: "{{ byobu if ansible_distribution_major_version < '9' | default(omit) }}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task runs for me, but yes we can change that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task runs for me, but yes we can change that

It runs because you are running the task in EL 9, so the variable byobu is never evaluated. If you run it on sn06 (running EL 8) you get this.

TASK [Debug.] ************************************************************************************************************************************************************************
fatal: [sn06.galaxyproject.eu]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'byobu' is undefined\n\nThe error appears to be in '/home/jose/Dokumente/Repositories/usegalaxy-eu_infrastructure-playbook/htcondor.yml': line 5, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  pre_tasks:\n    - name: Debug.\n      ^ here\n"}

Apart from that, "{{ 'byobu' if ansible_distribution_major_version < '9' }}" evaluates to an empty string when the condition after the if clause is not met, not to an undefined variable. Therefore the "default" filter does not come into action. You can realize this because the task

    - name: Debug.
      ansible.builtin.debug:
        msg: "{{ 'byobu' if ansible_distribution_major_version < '8' | default(omit) }}"

yields

TASK [Debug.] ************************************************************************************************************************************************************************
ok: [sn06.galaxyproject.eu] => {
    "msg": ""
}

on the headnode, but

    - name: Debug.
      ansible.builtin.debug:
        msg: "{{ 'byobu' if ansible_distribution_major_version < '8' else omit }}"

yields

TASK [Debug.] ************************************************************************************************************************************************************************
ok: [sn06.galaxyproject.eu] => {
    "msg": "Hello world!"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment on lines -7 to -18
- name: Check if firewalld is already installed
yum:
list: firewalld
# If not installed yum_list.results[*].yumstate != installed
register: yum_list

- name: Stop firewalld
service:
name: firewalld
state: stopped
enabled: no
when: yum_list.results | selectattr("yumstate", "match", "installed") | list | length != 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Role is used by:

  • telescope
  • apollo
  • build
  • plausible
  • cvmfs

Make sure that none of them assume that firewalld is disabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do not want to disable firewalld anywhere.
since this is read only friday, I will not touch other roles today. We can let this unmerged for now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I also think we do not want to disable firewalld anywhere. I am just commenting it so that we remember this.

@mira-miracoli mira-miracoli changed the title Changes to hxr.admin-tools DO NOT MERGE: Changes to hxr.admin-tools Nov 17, 2023
# If not installed yum_list.results[*].yumstate != installed
register: yum_list

- name: Stop firewalld
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fascinating, why would i do that?

I suspect it was because: internally we didn't strictly need a firewall, since a lot of that functionality was being provided in duplicate by OpenStack's firewall, and internally we did occasionally need random ports open for new services, but either way, that was some 🤠 nonsense, so, good that you add it back :)

Co-authored-by: José Manuel Domínguez <[email protected]>
@kysrpex kysrpex changed the title DO NOT MERGE: Changes to hxr.admin-tools Changes to hxr.admin-tools Nov 20, 2023
@mira-miracoli mira-miracoli merged commit 2bfa95b into usegalaxy-eu:master Nov 20, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants