mirror of
https://github.com/natelandau/ansible-homelab-config.git
synced 2025-11-18 09:53:41 -05:00
fix(ansible): add FQDN to ansible tasks
This commit is contained in:
@@ -11,6 +11,7 @@ exclude_paths:
|
||||
|
||||
skip_list:
|
||||
- command-instead-of-shell
|
||||
- name[template]
|
||||
- ignore-errors
|
||||
- meta-incorrect
|
||||
- meta-no-info
|
||||
|
||||
35
main.yml
35
main.yml
@@ -1,5 +1,6 @@
|
||||
---
|
||||
- hosts: all
|
||||
name: "Running playbook"
|
||||
serial: 1
|
||||
|
||||
vars_files:
|
||||
@@ -8,19 +9,19 @@
|
||||
|
||||
pre_tasks:
|
||||
- name: Run sanity checks
|
||||
import_tasks: tasks/sanity.yml
|
||||
ansible.builtin.import_tasks: tasks/sanity.yml
|
||||
tags: ["always", "sanity"]
|
||||
- name: populate service facts
|
||||
service_facts:
|
||||
ansible.builtin.service_facts:
|
||||
tags: ["nomad", "consul"]
|
||||
- name: Run debug tasks
|
||||
import_tasks: tasks/debug.yml
|
||||
ansible.builtin.import_tasks: tasks/debug.yml
|
||||
tags: [never, debug]
|
||||
- name: populate device specific variables
|
||||
import_tasks: tasks/interpolated_variables.yml
|
||||
ansible.builtin.import_tasks: tasks/interpolated_variables.yml
|
||||
tags: ["always"]
|
||||
- name: Ensure we have up-to-date packages
|
||||
import_tasks: tasks/packages.yml
|
||||
ansible.builtin.import_tasks: tasks/packages.yml
|
||||
tags: ["packages", "update"]
|
||||
- name: Set clean nomad_jobs_dir variable
|
||||
ansible.builtin.set_fact:
|
||||
@@ -29,50 +30,50 @@
|
||||
|
||||
tasks:
|
||||
- name: Configure cluster NFS mounts
|
||||
import_tasks: tasks/cluster_storage.yml
|
||||
ansible.builtin.import_tasks: tasks/cluster_storage.yml
|
||||
tags: ["storage"]
|
||||
when:
|
||||
- is_nomad_client or is_nomad_server or is_shared_storage_client
|
||||
- name: Install Docker
|
||||
import_tasks: tasks/docker.yml
|
||||
ansible.builtin.import_tasks: tasks/docker.yml
|
||||
tags: ["docker"]
|
||||
when: "'nas' not in group_names"
|
||||
- name: Install and Upgrade Consul
|
||||
import_tasks: tasks/consul.yml
|
||||
ansible.builtin.import_tasks: tasks/consul.yml
|
||||
tags: ["consul"]
|
||||
when: is_consul_client or is_consul_server
|
||||
- name: Install and Upgrade Nomad
|
||||
import_tasks: tasks/nomad.yml
|
||||
ansible.builtin.import_tasks: tasks/nomad.yml
|
||||
tags: ["nomad"]
|
||||
when: is_nomad_client or is_nomad_server
|
||||
- name: Orchestration Jobs
|
||||
import_tasks: tasks/orchestration_jobs.yml
|
||||
ansible.builtin.import_tasks: tasks/orchestration_jobs.yml
|
||||
tags: ["jobs", "update"]
|
||||
- name: Prometheus Node Exporter
|
||||
import_tasks: tasks/service_prometheus_nodeExporter.yml
|
||||
ansible.builtin.import_tasks: tasks/service_prometheus_nodeExporter.yml
|
||||
tags: ["prometheus_exporter"]
|
||||
when:
|
||||
- is_prometheus_node
|
||||
- "'pis' in group_names"
|
||||
- name: Install backup scripts
|
||||
import_tasks: tasks/backups.yml
|
||||
ansible.builtin.import_tasks: tasks/backups.yml
|
||||
tags: ["backup", "backups"]
|
||||
when: is_nomad_client or is_nomad_server
|
||||
- name: Install and configure Telegraf
|
||||
import_tasks: tasks/telegraf.yml
|
||||
ansible.builtin.import_tasks: tasks/telegraf.yml
|
||||
tags: ["telegraf"]
|
||||
when: is_telegraf_client
|
||||
- name: Pull repositories
|
||||
import_tasks: tasks/pull_repositories.yml
|
||||
ansible.builtin.import_tasks: tasks/pull_repositories.yml
|
||||
tags: ["never", "update", "repos"]
|
||||
- name: Configure log rotate
|
||||
import_tasks: tasks/logrotate.yml
|
||||
ansible.builtin.import_tasks: tasks/logrotate.yml
|
||||
tags: ["logrotate"]
|
||||
when: is_cluster_leader
|
||||
- name: Install and configure tdarr
|
||||
import_tasks: tasks/tdarr.yml
|
||||
ansible.builtin.import_tasks: tasks/tdarr.yml
|
||||
tags: ["tdarr"]
|
||||
when: is_tdarr_server or is_tdarr_node
|
||||
|
||||
handlers:
|
||||
- import_tasks: handlers/main.yml
|
||||
- ansible.builtin.import_tasks: handlers/main.yml
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
---
|
||||
# - name: architecture
|
||||
# debug:
|
||||
# ansible.builtin.debug:
|
||||
# var: ansible_facts['architecture']
|
||||
|
||||
# - name: distribution
|
||||
# debug:
|
||||
# ansible.builtin.debug:
|
||||
# var: ansible_facts['distribution']
|
||||
|
||||
# - name: distribution_file_variety
|
||||
# debug:
|
||||
# ansible.builtin.debug:
|
||||
# var: ansible_facts['distribution_file_variety']
|
||||
|
||||
# - name: service_mgr
|
||||
# debug:
|
||||
# ansible.builtin.debug:
|
||||
# var: ansible_facts['service_mgr']
|
||||
|
||||
# - name: os_family
|
||||
# debug:
|
||||
# ansible.builtin.debug:
|
||||
# var: ansible_facts['os_family']
|
||||
|
||||
# - debug:
|
||||
# - ansible.builtin.debug:
|
||||
# msg: "{{ ansible_os_family }}"
|
||||
|
||||
# - debug:
|
||||
# - ansible.builtin.debug:
|
||||
# msg: "pass: {{ ansible_become_pass }}"
|
||||
|
||||
# - debug:
|
||||
# - ansible.builtin.debug:
|
||||
# var: ansible_facts['nodename']
|
||||
|
||||
# - debug:
|
||||
# - ansible.builtin.debug:
|
||||
# var: ansible_facts['system_vendor']
|
||||
# when:
|
||||
# - ansible_facts['system_vendor'] is search("Synology")
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
- nodateext
|
||||
- nocreate
|
||||
- delaycompress
|
||||
import_role:
|
||||
ansible.builtin.import_role:
|
||||
name: arillso.logrotate
|
||||
failed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
failed_when: pull_script_output.rc > 1
|
||||
|
||||
- name: "Output from pull_all_repos"
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ pull_script_output.stdout }}"
|
||||
when:
|
||||
- not ansible_check_mode
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# NOTE: This is depreciated, I no longer use Prometheus and have migrated to Telegraf
|
||||
|
||||
- name: populate service facts
|
||||
service_facts:
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: stop node_exporter
|
||||
become: true
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
# --------------- Install or Update Prometheus
|
||||
- name: "set fact: need to install Prometheus?"
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
need_prometheus_install: false
|
||||
|
||||
- name: Check if node_exporter is installed
|
||||
@@ -39,7 +39,7 @@
|
||||
register: prometheus_binary_file_location
|
||||
|
||||
- name: "set fact: need to install Prometheus?"
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
need_prometheus_install: true
|
||||
when:
|
||||
- not prometheus_binary_file_location.stat.exists
|
||||
@@ -53,7 +53,7 @@
|
||||
- need_prometheus_install is false
|
||||
|
||||
- name: "set fact: need to install Prometheus?"
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
need_prometheus_install: true
|
||||
when:
|
||||
- need_prometheus_install is false
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
- mac_arm
|
||||
|
||||
- name: "set fact: do we need a tdarr install?"
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
need_tdarr_install: false
|
||||
|
||||
- name: Assert that we can install Tdarr
|
||||
@@ -90,7 +90,7 @@
|
||||
failed_when: false
|
||||
|
||||
- name: "set fact: do we need a tdarr install?"
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
need_tdarr_install: true
|
||||
when: not tdarr_exists.stat.exists
|
||||
|
||||
@@ -186,4 +186,4 @@
|
||||
- consul_agent_reload_http_response.status != 200
|
||||
|
||||
- name: mount shared storage
|
||||
import_tasks: cluster_storage.yml
|
||||
ansible.builtin.import_tasks: cluster_storage.yml
|
||||
|
||||
Reference in New Issue
Block a user