Skip to content

Commit

Permalink
Merge pull request #389 from igorribeiroduarte/rename_install_type
Browse files Browse the repository at this point in the history
Rename install_type in monitoring and node roles
  • Loading branch information
tarzanek authored Jul 2, 2024
2 parents 7e865b5 + fb2830a commit 27bfba9
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ansible-scylla-manager/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
keyring: "{{ scylla_repo_keyringfile }}"
state: present
with_items: "{{ scylla_manager_repo_keys }}"
when: install_type == 'online' and scylla_repo_keyserver is defined and scylla_manager_repo_keys is defined and (scylla_manager_repo_keys|length > 0)
when: scylla_install_type == 'online' and scylla_repo_keyserver is defined and scylla_manager_repo_keys is defined and (scylla_manager_repo_keys|length > 0)

- name: add Scylla Manager repo
get_url:
Expand Down
2 changes: 1 addition & 1 deletion ansible-scylla-monitoring/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Set this to "nondocker" for a flat installation or "docker" for the dockerized install (recommended)
# Default and recommended install is via docker
install_type: 'docker'
monitoring_install_type: 'docker'

# In some rare scenarios, it is impossible to run docker containers as a regular user. Set this to True if you need
# to use `sudo`
Expand Down
2 changes: 1 addition & 1 deletion ansible-scylla-monitoring/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
state: started
enabled: yes
become: true
when: install_type == "docker"
when: monitoring_install_type == "docker"
4 changes: 2 additions & 2 deletions ansible-scylla-monitoring/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
state: started
enabled: yes
become: true
when: install_type == "docker" #and ansible_distribution_major_version|int == 7
when: monitoring_install_type == "docker" #and ansible_distribution_major_version|int == 7

# - name: run docker related tasks for EL8
# block:
Expand All @@ -92,7 +92,7 @@
# shell: |
# touch /etc/containers/nodocker
# become: true
# when: install_type == "docker" and ansible_distribution_major_version|int > 7
# when: monitoring_install_type == "docker" and ansible_distribution_major_version|int > 7



Expand Down
4 changes: 2 additions & 2 deletions ansible-scylla-monitoring/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

- name: install dockerized monitoring
include_tasks: docker.yml
when: install_type == 'docker'
when: monitoring_install_type == 'docker'

- name: install non-dockerized monitoring
include_tasks: non-docker.yml
when: install_type != 'docker'
when: monitoring_install_type != 'docker'
2 changes: 1 addition & 1 deletion ansible-scylla-node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ cluster_local_files_path: "{{ inventory_dir }}"

# online|offline - offline will disable all the attepts to download packages
# node_exporter will need to be installed manually
install_type: online
scylla_install_type: online

# Defines if the node firewall should be enabled or not
# Values:
Expand Down
16 changes: 8 additions & 8 deletions ansible-scylla-node/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
ansible.builtin.file:
path: "{{ scylla_repo_keyringfile }}"
state: absent
when: "'gnupg2' in ansible_facts.packages and install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)"
when: "'gnupg2' in ansible_facts.packages and scylla_install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)"

- name: Remove an apt key by id previously added
ansible.builtin.apt_key:
id: "{{ item }}"
state: absent
with_items: "{{ scylla_repo_keys }}"
when: "'gnupg2' in ansible_facts.packages and install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)"
when: "'gnupg2' in ansible_facts.packages and scylla_install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)"

- name: Install gnupg2 dependency if it's not already installed
apt:
name: "gnupg2"
state: present
update_cache: yes
when: "'gnupg2' not in ansible_facts.packages and install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)"
when: "'gnupg2' not in ansible_facts.packages and scylla_install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)"

- name: Add an apt key by id from a keyserver
apt_key:
keyserver: "{{ scylla_repo_keyserver }}"
id: "{{ item }}"
state: present
with_items: "{{ scylla_repo_keys }}"
when: install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)
when: scylla_install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)

- name: create the keyring directory {{ scylla_repo_keyring_dir }}
file:
Expand All @@ -43,7 +43,7 @@
keyring: "{{ scylla_repo_keyringfile }}"
state: present
with_items: "{{ scylla_repo_keys }}"
when: install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)
when: scylla_install_type == 'online' and scylla_repo_keyserver is defined and scylla_repo_keys is defined and (scylla_repo_keys|length > 0)

- name: Add an Apt signing key for Debian
apt_key:
Expand All @@ -59,7 +59,7 @@
mode: '0644'
owner: root
with_items: "{{ scylla_deb_repos }}"
when: install_type == 'online' and item.split(".")[-1] == "list"
when: scylla_install_type == 'online' and item.split(".")[-1] == "list"

become: true

Expand Down Expand Up @@ -101,7 +101,7 @@
id: "{{ item }}"
state: present
with_items: "{{ scylla_manager_repo_keys }}"
when: (install_type == 'online') and (scylla_repo_keyserver is defined) and (scylla_manager_repo_keys is defined) and (scylla_manager_repo_keys|length > 0)
when: (scylla_install_type == 'online') and (scylla_repo_keyserver is defined) and (scylla_manager_repo_keys is defined) and (scylla_manager_repo_keys|length > 0)
become: true

- name: Add an apt key by id from a keyserver to {{ scylla_repo_keyringfile }}
Expand All @@ -111,7 +111,7 @@
id: "{{ item }}"
state: present
with_items: "{{ scylla_manager_repo_keys }}"
when: (install_type == 'online') and (scylla_repo_keyserver is defined) and (scylla_manager_repo_keys is defined) and (scylla_manager_repo_keys|length > 0)
when: (scylla_install_type == 'online') and (scylla_repo_keyserver is defined) and (scylla_manager_repo_keys is defined) and (scylla_manager_repo_keys|length > 0)
become: true

- name: add Scylla Manager repo
Expand Down
6 changes: 3 additions & 3 deletions ansible-scylla-node/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
rpm_key:
state: present
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}
when: install_type == 'online' and (ansible_distribution == "CentOS" or ansible_distribution == "RedHat")
when: scylla_install_type == 'online' and (ansible_distribution == "CentOS" or ansible_distribution == "RedHat")
become: true

- name: Add EPEL repository
yum:
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
state: present
lock_timeout: 60
when: install_type == 'online' and (ansible_distribution == "CentOS" or ansible_distribution == "RedHat")
when: scylla_install_type == 'online' and (ansible_distribution == "CentOS" or ansible_distribution == "RedHat")
become: true

- name: Install ELRepo kernel and reboot in to it if configured
Expand Down Expand Up @@ -63,7 +63,7 @@
post_reboot_delay: 30
test_command: whoami
when: reboot_after_kernel_upgrade|bool and kernel_installed.changed
when: elrepo_kernel|bool and install_type == 'online' and (ansible_distribution == "CentOS" or ansible_distribution == "RedHat")
when: elrepo_kernel|bool and scylla_install_type == 'online' and (ansible_distribution == "CentOS" or ansible_distribution == "RedHat")
become: true

- name: remove abrt
Expand Down
2 changes: 1 addition & 1 deletion ansible-scylla-node/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
- name: node exporter setup
shell: |
node_exporter_install --force
when: install_type == 'online'
when: scylla_install_type == 'online'
become: true
notify:
- node_exporter start
Expand Down
4 changes: 2 additions & 2 deletions ansible-scylla-node/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
- name: Set scylla_version_to_install to {{ scylla_latest_version.json['version'] }}
set_fact:
scylla_version_to_install: "{{ scylla_latest_version.json['version'] }}"
when: scylla_version == 'latest' and install_type == 'online'
when: scylla_version == 'latest' and scylla_install_type == 'online'

- name: "Sanity check: latest version requires online installation type"
fail:
msg: "Latest Scylla version can only be installed with an 'online' installation"
when: scylla_version == 'latest' and install_type != 'online'
when: scylla_version == 'latest' and scylla_install_type != 'online'

- name: Set a repository URL if not explicitly set
include_tasks: set_default_repo.yml
Expand Down

0 comments on commit 27bfba9

Please sign in to comment.