fix(ansible): add FQDN to ansible tasks

This commit is contained in:
Nathaniel Landau
2022-10-07 14:41:11 -04:00
parent f5497c0983
commit 0d92a7e879
7 changed files with 37 additions and 35 deletions

View File

@@ -11,6 +11,7 @@ exclude_paths:
skip_list: skip_list:
- command-instead-of-shell - command-instead-of-shell
- name[template]
- ignore-errors - ignore-errors
- meta-incorrect - meta-incorrect
- meta-no-info - meta-no-info

View File

@@ -1,5 +1,6 @@
--- ---
- hosts: all - hosts: all
name: "Running playbook"
serial: 1 serial: 1
vars_files: vars_files:
@@ -8,19 +9,19 @@
pre_tasks: pre_tasks:
- name: Run sanity checks - name: Run sanity checks
import_tasks: tasks/sanity.yml ansible.builtin.import_tasks: tasks/sanity.yml
tags: ["always", "sanity"] tags: ["always", "sanity"]
- name: populate service facts - name: populate service facts
service_facts: ansible.builtin.service_facts:
tags: ["nomad", "consul"] tags: ["nomad", "consul"]
- name: Run debug tasks - name: Run debug tasks
import_tasks: tasks/debug.yml ansible.builtin.import_tasks: tasks/debug.yml
tags: [never, debug] tags: [never, debug]
- name: populate device specific variables - name: populate device specific variables
import_tasks: tasks/interpolated_variables.yml ansible.builtin.import_tasks: tasks/interpolated_variables.yml
tags: ["always"] tags: ["always"]
- name: Ensure we have up-to-date packages - name: Ensure we have up-to-date packages
import_tasks: tasks/packages.yml ansible.builtin.import_tasks: tasks/packages.yml
tags: ["packages", "update"] tags: ["packages", "update"]
- name: Set clean nomad_jobs_dir variable - name: Set clean nomad_jobs_dir variable
ansible.builtin.set_fact: ansible.builtin.set_fact:
@@ -29,50 +30,50 @@
tasks: tasks:
- name: Configure cluster NFS mounts - name: Configure cluster NFS mounts
import_tasks: tasks/cluster_storage.yml ansible.builtin.import_tasks: tasks/cluster_storage.yml
tags: ["storage"] tags: ["storage"]
when: when:
- is_nomad_client or is_nomad_server or is_shared_storage_client - is_nomad_client or is_nomad_server or is_shared_storage_client
- name: Install Docker - name: Install Docker
import_tasks: tasks/docker.yml ansible.builtin.import_tasks: tasks/docker.yml
tags: ["docker"] tags: ["docker"]
when: "'nas' not in group_names" when: "'nas' not in group_names"
- name: Install and Upgrade Consul - name: Install and Upgrade Consul
import_tasks: tasks/consul.yml ansible.builtin.import_tasks: tasks/consul.yml
tags: ["consul"] tags: ["consul"]
when: is_consul_client or is_consul_server when: is_consul_client or is_consul_server
- name: Install and Upgrade Nomad - name: Install and Upgrade Nomad
import_tasks: tasks/nomad.yml ansible.builtin.import_tasks: tasks/nomad.yml
tags: ["nomad"] tags: ["nomad"]
when: is_nomad_client or is_nomad_server when: is_nomad_client or is_nomad_server
- name: Orchestration Jobs - name: Orchestration Jobs
import_tasks: tasks/orchestration_jobs.yml ansible.builtin.import_tasks: tasks/orchestration_jobs.yml
tags: ["jobs", "update"] tags: ["jobs", "update"]
- name: Prometheus Node Exporter - name: Prometheus Node Exporter
import_tasks: tasks/service_prometheus_nodeExporter.yml ansible.builtin.import_tasks: tasks/service_prometheus_nodeExporter.yml
tags: ["prometheus_exporter"] tags: ["prometheus_exporter"]
when: when:
- is_prometheus_node - is_prometheus_node
- "'pis' in group_names" - "'pis' in group_names"
- name: Install backup scripts - name: Install backup scripts
import_tasks: tasks/backups.yml ansible.builtin.import_tasks: tasks/backups.yml
tags: ["backup", "backups"] tags: ["backup", "backups"]
when: is_nomad_client or is_nomad_server when: is_nomad_client or is_nomad_server
- name: Install and configure Telegraf - name: Install and configure Telegraf
import_tasks: tasks/telegraf.yml ansible.builtin.import_tasks: tasks/telegraf.yml
tags: ["telegraf"] tags: ["telegraf"]
when: is_telegraf_client when: is_telegraf_client
- name: Pull repositories - name: Pull repositories
import_tasks: tasks/pull_repositories.yml ansible.builtin.import_tasks: tasks/pull_repositories.yml
tags: ["never", "update", "repos"] tags: ["never", "update", "repos"]
- name: Configure log rotate - name: Configure log rotate
import_tasks: tasks/logrotate.yml ansible.builtin.import_tasks: tasks/logrotate.yml
tags: ["logrotate"] tags: ["logrotate"]
when: is_cluster_leader when: is_cluster_leader
- name: Install and configure tdarr - name: Install and configure tdarr
import_tasks: tasks/tdarr.yml ansible.builtin.import_tasks: tasks/tdarr.yml
tags: ["tdarr"] tags: ["tdarr"]
when: is_tdarr_server or is_tdarr_node when: is_tdarr_server or is_tdarr_node
handlers: handlers:
- import_tasks: handlers/main.yml - ansible.builtin.import_tasks: handlers/main.yml

View File

@@ -1,34 +1,34 @@
--- ---
# - name: architecture # - name: architecture
# debug: # ansible.builtin.debug:
# var: ansible_facts['architecture'] # var: ansible_facts['architecture']
# - name: distribution # - name: distribution
# debug: # ansible.builtin.debug:
# var: ansible_facts['distribution'] # var: ansible_facts['distribution']
# - name: distribution_file_variety # - name: distribution_file_variety
# debug: # ansible.builtin.debug:
# var: ansible_facts['distribution_file_variety'] # var: ansible_facts['distribution_file_variety']
# - name: service_mgr # - name: service_mgr
# debug: # ansible.builtin.debug:
# var: ansible_facts['service_mgr'] # var: ansible_facts['service_mgr']
# - name: os_family # - name: os_family
# debug: # ansible.builtin.debug:
# var: ansible_facts['os_family'] # var: ansible_facts['os_family']
# - debug: # - ansible.builtin.debug:
# msg: "{{ ansible_os_family }}" # msg: "{{ ansible_os_family }}"
# - debug: # - ansible.builtin.debug:
# msg: "pass: {{ ansible_become_pass }}" # msg: "pass: {{ ansible_become_pass }}"
# - debug: # - ansible.builtin.debug:
# var: ansible_facts['nodename'] # var: ansible_facts['nodename']
# - debug: # - ansible.builtin.debug:
# var: ansible_facts['system_vendor'] # var: ansible_facts['system_vendor']
# when: # when:
# - ansible_facts['system_vendor'] is search("Synology") # - ansible_facts['system_vendor'] is search("Synology")

View File

@@ -23,7 +23,7 @@
- nodateext - nodateext
- nocreate - nocreate
- delaycompress - delaycompress
import_role: ansible.builtin.import_role:
name: arillso.logrotate name: arillso.logrotate
failed_when: false failed_when: false
ignore_errors: true ignore_errors: true

View File

@@ -29,7 +29,7 @@
failed_when: pull_script_output.rc > 1 failed_when: pull_script_output.rc > 1
- name: "Output from pull_all_repos" - name: "Output from pull_all_repos"
debug: ansible.builtin.debug:
msg: "{{ pull_script_output.stdout }}" msg: "{{ pull_script_output.stdout }}"
when: when:
- not ansible_check_mode - not ansible_check_mode

View File

@@ -5,7 +5,7 @@
# NOTE: This is depreciated, I no longer use Prometheus and have migrated to Telegraf # NOTE: This is depreciated, I no longer use Prometheus and have migrated to Telegraf
- name: populate service facts - name: populate service facts
service_facts: ansible.builtin.service_facts:
- name: stop node_exporter - name: stop node_exporter
become: true become: true
@@ -30,7 +30,7 @@
# --------------- Install or Update Prometheus # --------------- Install or Update Prometheus
- name: "set fact: need to install Prometheus?" - name: "set fact: need to install Prometheus?"
set_fact: ansible.builtin.set_fact:
need_prometheus_install: false need_prometheus_install: false
- name: Check if node_exporter is installed - name: Check if node_exporter is installed
@@ -39,7 +39,7 @@
register: prometheus_binary_file_location register: prometheus_binary_file_location
- name: "set fact: need to install Prometheus?" - name: "set fact: need to install Prometheus?"
set_fact: ansible.builtin.set_fact:
need_prometheus_install: true need_prometheus_install: true
when: when:
- not prometheus_binary_file_location.stat.exists - not prometheus_binary_file_location.stat.exists
@@ -53,7 +53,7 @@
- need_prometheus_install is false - need_prometheus_install is false
- name: "set fact: need to install Prometheus?" - name: "set fact: need to install Prometheus?"
set_fact: ansible.builtin.set_fact:
need_prometheus_install: true need_prometheus_install: true
when: when:
- need_prometheus_install is false - need_prometheus_install is false

View File

@@ -38,7 +38,7 @@
- mac_arm - mac_arm
- name: "set fact: do we need a tdarr install?" - name: "set fact: do we need a tdarr install?"
set_fact: ansible.builtin.set_fact:
need_tdarr_install: false need_tdarr_install: false
- name: Assert that we can install Tdarr - name: Assert that we can install Tdarr
@@ -90,7 +90,7 @@
failed_when: false failed_when: false
- name: "set fact: do we need a tdarr install?" - name: "set fact: do we need a tdarr install?"
set_fact: ansible.builtin.set_fact:
need_tdarr_install: true need_tdarr_install: true
when: not tdarr_exists.stat.exists when: not tdarr_exists.stat.exists
@@ -186,4 +186,4 @@
- consul_agent_reload_http_response.status != 200 - consul_agent_reload_http_response.status != 200
- name: mount shared storage - name: mount shared storage
import_tasks: cluster_storage.yml ansible.builtin.import_tasks: cluster_storage.yml