Skip to content

Commit

Permalink
feat: disable repos when running offline
Browse files Browse the repository at this point in the history
Signed-off-by: Albert van der Land <albertvanderland@gmail.com>
  • Loading branch information
avdland committed Sep 29, 2023
1 parent 58b21e1 commit d10c9fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions roles/node_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_exporter_binary_url: "https://github.com/{{ _node_exporter_repo }}/releases
node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}.tar.gz"
node_exporter_checksums_url: "https://github.com/{{ _node_exporter_repo }}/releases/download/v{{ node_exporter_version }}/sha256sums.txt"
node_exporter_skip_install: false
node_exporter_offline: false

node_exporter_web_listen_address: "0.0.0.0:9100"
node_exporter_web_telemetry_path: "/metrics"
Expand Down
4 changes: 3 additions & 1 deletion roles/node_exporter/tasks/selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
if ansible_python_version is version('3', '<') else
['python3-libselinux', 'python3-policycoreutils'] }}"
state: present
disablerepo: "{{ '*' if node_exporter_offline else '' }}"
register: _install_selinux_packages
until: _install_selinux_packages is success
retries: 5
delay: 2
when: ansible_os_family | lower == "redhat"
when:
- ansible_os_family | lower == "redhat"

- name: Install selinux python packages [clearlinux]
ansible.builtin.package:
Expand Down

0 comments on commit d10c9fb

Please sign in to comment.