Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
kvelarde-itential committed Sep 18, 2024
2 parents e00cea0 + f9c6866 commit 33934ed
Show file tree
Hide file tree
Showing 48 changed files with 255 additions and 218 deletions.
4 changes: 3 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

# Exclude these files from the linter
exclude_paths:
- .gitlab
- .git*

# Rules that we feel should not be errors but warnings
warn_list:
- yaml[line-length]
- var-naming[no-role-prefix]
- meta-runtime[unsupported-version]
- run-once[task]
11 changes: 6 additions & 5 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ readme: README.md
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Steven Schattenberg <steven.schattenberg@itential.com>
- Travis Nicks <travis.nicks@itential.com>
- Kevin Velarde <kevin.velarde@itential.com>
- Peter Sprygada <peter.sprygada@itential.com>
- Nick Andreano <nick.andreano@itential.com>
- Steven Schattenberg <steven.schattenberg@itential.com>
- Travis Nicks <travis.nicks@itential.com>
- Kevin Velarde <kevin.velarde@itential.com>
- Peter Sprygada <peter.sprygada@itential.com>
- Nick Andreano <nick.andreano@itential.com>

### OPTIONAL but strongly recommended
# A short summary description of the collection
Expand All @@ -38,6 +38,7 @@ license_file: 'LICENSE'
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags:
- tools
- itential
- deployer

Expand Down
13 changes: 0 additions & 13 deletions playbooks/install_active_standby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@
- mongodb
- mongodb_install

# Insert some day zero data into the MongoDB, Itential users, profiles,
# configure redis, configure rabbitmq, etc...
- role: itential.deployer.mongodb_init
tags:
- mongodb
- mongodb_init

# Enable MongoDB replication, configure replica set if required
# https://www.mongodb.com/docs/manual/replication/
- role: itential.deployer.mongodb_replication
Expand Down Expand Up @@ -129,12 +122,6 @@
- platform
- platform_install

# Install any listed apps and/or adapters
- role: itential.deployer.platform_adapters
tags:
- platform
- platform_adapters

- name: Install IAP
hosts: platform
become: true
Expand Down
4 changes: 2 additions & 2 deletions playbooks/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- role: itential.deployer.common_vars
tags:
- always

- role: itential.deployer.prometheus
tags:
- prometheus_install
- prometheus_install
2 changes: 1 addition & 1 deletion roles/common_vars/defaults/main/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
---
prometheus: false
prometheus_grafana: false
prometheus_grafana: false
2 changes: 1 addition & 1 deletion roles/gateway/tasks/download-packages-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
file: download-python-dependencies.yml

- name: Uninstall Python rpms
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: absent
autoremove: true
Expand Down
4 changes: 2 additions & 2 deletions roles/gateway/tasks/download-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
tags: download_gateway_packages

- name: Install Gateway rpms
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: present
with_items: "{{ gateway_packages }}"
Expand Down Expand Up @@ -71,7 +71,7 @@
dest_dir: "{{ rpms_download_dir_control_node }}"

- name: Uninstall Gateway packages
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: absent
autoremove: true
Expand Down
2 changes: 1 addition & 1 deletion roles/gateway/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
register: workingdir

- name: Install Gateway packages (online)
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: present
with_items: "{{ gateway_packages }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/mongodb/tasks/download-packages-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- app_python_dependencies | length > 0

- name: Uninstall Python rpms
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: absent
autoremove: true
Expand Down
2 changes: 1 addition & 1 deletion roles/mongodb/tasks/mongodb-online.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Install mongodb if mongodb is not already installed
- name: Install MongoDB packages (online)
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ mongodb_packages }}"
state: present
when: "'mongodb-org' not in ansible_facts.packages"
6 changes: 3 additions & 3 deletions roles/offline/tasks/download-adapter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ansible.builtin.set_fact:
adapter_name: "{{ adapter | basename | split('.') | first }}"

- name: Git clone {{ adapter }}
- name: Git clone adapter # noqa: latest (always clone the latest)
ansible.builtin.git:
repo: "{{ adapter }}"
dest: "{{ download_dir }}/{{ adapter_name }}"
Expand All @@ -35,9 +35,9 @@
chdir: "{{ download_dir }}/{{ adapter_name }}"
changed_when: true

# The bundleDependencies defines an array of package names that will be bundled
# The bundleDependencies defines an array of package names that will be bundled
# when publishing the package. This really should be defined in the package.json
# when it's downloaded. If it is not already defined, set it to true. A value of true
# when it's downloaded. If it is not already defined, set it to true. A value of true
# will bundle all dependencies.
- name: Check if bundleDependencies is already defined in package.json
ansible.builtin.lineinfile:
Expand Down
9 changes: 4 additions & 5 deletions roles/offline/tasks/download-rpms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@
mode: '0755'

- name: Download packages (ansible yum module)
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ download_packages }}"
state: present
download_only: true
download_dir: "{{ download_dir }}"
when: download_method == "yum_module"

- name: Download packages (yum install)
- name: Download packages (yum install) # noqa command-instead-of-module (yum module does not support downloadonly)
ansible.builtin.command:
cmd: yum install --downloadonly --downloaddir "{{ download_dir }}" -y "{{ download_packages }}"
changed_when: true
when: download_method == "yum_install"

- name: Download packages (yum reinstall)
- name: Download packages (yum reinstall) # noqa command-instead-of-module (yum module does not support downloadonly)
ansible.builtin.command:
cmd: yum reinstall --downloadonly --downloaddir "{{ download_dir }}" -y "{{ download_packages }}"
changed_when: true
Expand All @@ -60,7 +60,7 @@
when: download_method == "yumdownloader"
block:
- name: Install Yum utils
ansible.builtin.yum:
ansible.builtin.dnf:
name: yum-utils
state: present

Expand All @@ -69,4 +69,3 @@
cmd: "yumdownloader --resolve --downloaddir {{ download_dir }} {{ download_packages | join(' ') }}"
changed_when: true
failed_when: false

4 changes: 2 additions & 2 deletions roles/offline/tasks/install-rpms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
ansible.builtin.command: rpmdb --rebuilddb
changed_when: false

- name: Get list of yum repos (to disable temporarily)
- name: Get list of yum repos (to disable temporarily) # noqa command-instead-of-module (yum module does not support repolist)
ansible.builtin.command: yum -q repolist
register: repolist_result
changed_when: false

- name: Install RPMs
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ rpm_list.files | map(attribute='path') | list | sort }}"
state: present
disable_gpg_check: true
Expand Down
6 changes: 3 additions & 3 deletions roles/os/tasks/redhat-online.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- name: Install OS Packages
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ os_packages }}"
state: present
validate_certs: false
skip_broken: true
update_cache: true

- name: Install Security Packages
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ security_packages }}"
state: present

- name: Install Operations Packages
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ operational_packages }}"
state: present
3 changes: 3 additions & 0 deletions roles/platform/tasks/backup-mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
- --out="{{ iap_install_dir }}/current/backups"
- --gzip
- "{{ mongo_connection_string }}"
register: result
changed_when: result.rc == 0
failed_when: result.rc > 0
10 changes: 4 additions & 6 deletions roles/platform/tasks/configure-firewalld.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
immediate: true
when:
- ansible_facts.services["firewalld.service"] is defined
- (ansible_facts.services["firewalld.service"].state == "running")
- (ansible_facts.services["firewalld.service"].status == "enabled")
- ansible_facts.services["firewalld.service"].state == "running"
- ansible_facts.services["firewalld.service"].status == "enabled"
- not iap_https | bool
ignore_errors: true

- name: Open HTTPS Port on FirewallD Public Zone
ansible.posix.firewalld:
Expand All @@ -28,7 +27,6 @@
immediate: true
when:
- ansible_facts.services["firewalld.service"] is defined
- (ansible_facts.services["firewalld.service"].state == "running")
- (ansible_facts.services["firewalld.service"].status == "enabled")
- ansible_facts.services["firewalld.service"].state == "running"
- ansible_facts.services["firewalld.service"].status == "enabled"
- iap_https | bool
ignore_errors: true
13 changes: 7 additions & 6 deletions roles/platform/tasks/download-adapters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- name: Install rpms required for download
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: present
with_items:
Expand All @@ -11,10 +11,11 @@
register: install_result

- name: Disable safe repository checks
ansible.builtin.command:
cmd: "git config --global --add safe.directory '*'"
community.general.git_config:
name: safe.directory
scope: global
value: '*'
when: disable_git_safe_repo_checks
changed_when: true

- name: Install NodeJS
ansible.builtin.include_tasks:
Expand Down Expand Up @@ -75,14 +76,14 @@
with_items: "{{ found_custom_adapters.files }}"

- name: Uninstall rpms required for download
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: absent
autoremove: true
with_items: "{{ install_result.results | selectattr('changed', 'equalto', true) | map(attribute='item') }}"

- name: Uninstall nodejs rpms
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: absent
autoremove: true
Expand Down
2 changes: 1 addition & 1 deletion roles/platform/tasks/download-packages-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
download_dir: "{{ wheels_download_dir_target_node }}/app"

- name: Uninstall Python rpms
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ item }}"
state: absent
autoremove: true
Expand Down
17 changes: 9 additions & 8 deletions roles/platform/tasks/install-adapters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- name: Disable safe repository checks
ansible.builtin.command:
cmd: "git config --global --add safe.directory '*'"
community.general.git_config:
name: safe.directory
scope: global
value: '*'
when: disable_git_safe_repo_checks
changed_when: true

- name: Install any configured opensource adapters
when:
Expand All @@ -27,15 +28,15 @@
# symlinks.
- name: Make a list of the adapter names
ansible.builtin.set_fact:
adapter_names: "{{ adapter_names + [item | basename | split('.') | first ]}}"
adapter_names: "{{ adapter_names + [item | basename | split('.') | first] }}"
loop: "{{ itential_adapters | default([], true) }}"
vars:
adapter_names: []

- name: Install opensource adapters (online)
when: not offline_install
block:
- name: Git clone opensource adapters (online)
- name: Git clone opensource adapters (online) # noqa: latest (always clone the latest)
ansible.builtin.git:
repo: "{{ item }}"
dest: "{{ iap_install_dir }}/current/custom/@itentialopensource/{{ adapter_names[i] }}"
Expand Down Expand Up @@ -142,15 +143,15 @@
# symlinks.
- name: Make a list of the custom adapter names
ansible.builtin.set_fact:
custom_names: "{{ custom_names + [item | basename | split('.') | first ]}}"
custom_names: "{{ custom_names + [item | basename | split('.') | first] }}"
loop: "{{ custom_adapters | default([], true) }}"
vars:
custom_names: []

- name: Install custom adapters (online)
when: not offline_install
block:
- name: Git clone all custom adapters (online)
- name: Git clone all custom adapters (online) # noqa: latest (always clone the latest)
ansible.builtin.git:
repo: "{{ item }}"
dest: "{{ iap_install_dir }}/current/custom/{{ custom_location }}/{{ custom_names[i] }}"
Expand Down Expand Up @@ -224,7 +225,7 @@
- name: Restart IAP
ansible.builtin.command: /bin/true
notify: Restart IAP
when: >
when: >
(custom_adapters is defined and (custom_adapters | default([], true)) | length > 0) or
(itential_adapters is defined and (itential_adapters | default([], true)) | length > 0)
changed_when: true
2 changes: 1 addition & 1 deletion roles/platform/tasks/install-mongodb-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@

# Install mongodb tools if they are not already installed
- name: Install the MongoDB tools packages
ansible.builtin.yum:
ansible.builtin.dnf:
name: "{{ mongodb_tools_packages }}"
state: present
2 changes: 1 addition & 1 deletion roles/platform/tasks/install-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

# This will perform the actual install of nodejs
- name: Yum install nodejs
ansible.builtin.yum:
ansible.builtin.dnf:
name: nodejs
state: present

Expand Down
Loading

0 comments on commit 33934ed

Please sign in to comment.