Skip to content

Commit

Permalink
refactor: streamline molecule alternative scenario further
Browse files Browse the repository at this point in the history
Signed-off-by: gardar <[email protected]>
  • Loading branch information
gardar committed Sep 27, 2024
1 parent 4e98e1f commit c8b2516
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .config/molecule/alternative/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
vars:
__role_name: "{{ lookup('ansible.builtin.env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
__binary_name: "{{ __role_name }}"
__binary_url: "{{ lookup('ansible.builtin.vars', __role_name ~ '_binary_url') }}"
__binary_local_dir: "{{ lookup('ansible.builtin.vars', __role_name ~ '_binary_local_dir') }}"
__binary_url: "{{ lookup('ansible.builtin.vars', __role_name ~ '_binary_url', default='') }}"
__binary_local_dir: "{{ lookup('ansible.builtin.vars', __role_name ~ '_binary_local_dir', default='') }}"
__tls_server_config: "{{ lookup('ansible.builtin.vars', __role_name ~ '_tls_server_config', default={}) }}"
tasks:
- name: "Create local binary directory"
ansible.builtin.file:
path: "{{ __binary_local_dir }}"
state: directory
mode: 0755
when: (__binary_local_dir)

- name: "Fetch binary"
become: false
Expand All @@ -27,6 +28,7 @@
creates: "{{ __binary_local_dir }}/{{ __binary_name }}"
check_mode: false
register: __download_binary
when: (__binary_url)

- name: Generate self signed certificates
when: "'cert_file' in __tls_server_config"
Expand Down
3 changes: 0 additions & 3 deletions roles/cadvisor/molecule/alternative/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ provisioner:
inventory:
group_vars:
all:
cadvisor_binary_url: "https://github.com/google/cadvisor/releases/download/v{{ cadvisor_version }}/cadvisor-v{{ cadvisor_version }}-linux-{{ go_arch }}"
cadvisor_binary_local_dir: "/tmp"
cadvisor_port: "8000"
go_arch: amd64
cadvisor_version: 0.47.0
cadvisor_enable_metrics:
- tcp
Expand Down
4 changes: 0 additions & 4 deletions roles/fail2ban_exporter/molecule/alternative/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@ provisioner:
inventory:
group_vars:
all:
fail2ban_exporter_binary_local_dir: "/tmp/fail2ban_exporter-linux-amd64_local"
fail2ban_exporter_web_listen_address: "127.0.1.1:9191"
go_arch: amd64
fail2ban_exporter_version: 0.10.1
fail2ban_exporter_binary_url: "https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/releases/v{{ fail2ban_exporter_version }}/downloads/\
fail2ban_exporter_{{ fail2ban_exporter_version }}_linux_{{ go_arch }}.tar.gz"
4 changes: 0 additions & 4 deletions roles/nginx_exporter/molecule/alternative/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ provisioner:
inventory:
group_vars:
all:
nginx_exporter_binary_local_dir: "/tmp/nginx_exporter-linux-amd64_local"
nginx_exporter_web_listen_address: "127.0.0.1:9113"
nginx_exporter_tls_server_config:
cert_file: /etc/nginx_exporter/tls.cert
Expand All @@ -14,7 +13,4 @@ provisioner:
http2: true
nginx_exporter_basic_auth_users:
randomuser: examplepassword
go_arch: amd64
nginx_exporter_version: 1.1.0
nginx_exporter_binary_url: "https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/v{{ nginx_exporter_version }}/\
nginx-prometheus-exporter_{{ nginx_exporter_version }}_linux_{{ go_arch }}.tar.gz"

0 comments on commit c8b2516

Please sign in to comment.