diff --git a/.ansible-lint.yml b/.ansible-lint.yml index 8f09161..d0793e3 100644 --- a/.ansible-lint.yml +++ b/.ansible-lint.yml @@ -11,6 +11,7 @@ exclude_paths: skip_list: - command-instead-of-shell + - name[template] - ignore-errors - meta-incorrect - meta-no-info diff --git a/main.yml b/main.yml index 54ed179..faac9d4 100644 --- a/main.yml +++ b/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 diff --git a/tasks/debug.yml b/tasks/debug.yml index a80ee61..9448138 100644 --- a/tasks/debug.yml +++ b/tasks/debug.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") diff --git a/tasks/logrotate.yml b/tasks/logrotate.yml index aad5dcd..6b63dc9 100644 --- a/tasks/logrotate.yml +++ b/tasks/logrotate.yml @@ -23,7 +23,7 @@ - nodateext - nocreate - delaycompress - import_role: + ansible.builtin.import_role: name: arillso.logrotate failed_when: false ignore_errors: true diff --git a/tasks/pull_repositories.yml b/tasks/pull_repositories.yml index 2d172c4..c368828 100644 --- a/tasks/pull_repositories.yml +++ b/tasks/pull_repositories.yml @@ -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 diff --git a/tasks/service_prometheus_nodeExporter.yml b/tasks/service_prometheus_nodeExporter.yml index 387bbab..b4ba321 100644 --- a/tasks/service_prometheus_nodeExporter.yml +++ b/tasks/service_prometheus_nodeExporter.yml @@ -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 diff --git a/tasks/tdarr.yml b/tasks/tdarr.yml index db435f2..c33996c 100644 --- a/tasks/tdarr.yml +++ b/tasks/tdarr.yml @@ -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