further specified task names, corrected task conditional case tests
This commit is contained in:
@@ -2,19 +2,24 @@
|
||||
---
|
||||
# tasks file for roles/init-vps
|
||||
- name: Checking whether administrative login used
|
||||
when: ansible_facts["user_id"] not in (admins | map(attribute="username") | list)
|
||||
when: ansible_user not in (admins | map(attribute="username") | list)
|
||||
ansible.builtin.fail:
|
||||
msg: Must use administrative user for subsequent tasks
|
||||
- name: Creating prerequisite directory tree
|
||||
- name: Creating prerequisite directory tree for installation scripts
|
||||
ansible.builtin.file:
|
||||
path: "{{ ansible_facts['user_dir'] }}/.local/bin"
|
||||
recurse: true
|
||||
state: directory
|
||||
- name: Creating prerequisite directory tree
|
||||
- name: Creating prerequisite directory tree for unarchived archives
|
||||
ansible.builtin.file:
|
||||
path: "{{ ansible_facts['user_dir'] }}/downloads/archives/released"
|
||||
recurse: true
|
||||
state: directory
|
||||
- name: Creating prerequisite directory tree for package installation executables
|
||||
ansible.builtin.file:
|
||||
path: "{{ ansible_facts['user_dir'] }}/.local_pkgs"
|
||||
recurse: true
|
||||
state: directory
|
||||
- name: Installing Linux software
|
||||
when: ansible_facts["system"] == "Linux"
|
||||
block:
|
||||
@@ -23,7 +28,7 @@
|
||||
become: true
|
||||
block:
|
||||
- name: Registering a package signing key
|
||||
when: item.key is defined and item.key_path is defined
|
||||
when: item.key != None and item.key_path != None
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ item.key }}"
|
||||
dest: "{{ item.key_path | default('/etc/apt/keyrings/') }}"
|
||||
@@ -33,14 +38,16 @@
|
||||
force: true
|
||||
backup: true
|
||||
loop: "{{ pkgs.mngr.core + pkgs.mngr.userspace | rejectattr('key', 'search', '\\.deb$') }}"
|
||||
- name: Premature stop
|
||||
ansible.builtin.meta: end_play
|
||||
- name: Installing a package signing key
|
||||
when: item.key is defined
|
||||
when: item.key != None
|
||||
ansible.builtin.apt:
|
||||
deb: "{{ item.key }}"
|
||||
state: present
|
||||
loop: "{{ pkgs.mngr.core + pkgs.mngr.userspace | selectattr('key', 'search', '\\.deb$') }}"
|
||||
- name: Registering a package source
|
||||
when: item.src_entry is defined and item.src_path is defined
|
||||
when: item.src_entry != None and item.src_path != None
|
||||
ansible.builtin.copy:
|
||||
content: "{{ item.src_entry }}"
|
||||
dest: "{{ item.src_path }}"
|
||||
@@ -51,7 +58,7 @@
|
||||
backup: true
|
||||
loop: "{{ pkgs.mngr.core + pkgs.mngr.userspace }}"
|
||||
- name: Installing a local package in managed node
|
||||
when: item.uri is defined
|
||||
when: item.uri != None
|
||||
ansible.builtin.apt:
|
||||
deb: "{{ item.uri }}"
|
||||
update_cache: true
|
||||
@@ -59,7 +66,7 @@
|
||||
notify: "{{ item.name }}"
|
||||
loop: "{{ pkgs.mngr.core + pkgs.mngr.userspace | selectattr('uri', 'search', '\\.deb$') }}"
|
||||
- name: Installing a package
|
||||
when: item.name is defined and item.uri is undefined
|
||||
when: item.name != None and item.uri == None
|
||||
ansible.builtin.package:
|
||||
name: "{{ item.name }}"
|
||||
update_cache: true
|
||||
@@ -69,7 +76,7 @@
|
||||
tags:
|
||||
- get_mngr_pkgs
|
||||
- name: Installing software by executing installation shell scripts
|
||||
when: item.src is defined
|
||||
when: item.src != None
|
||||
block:
|
||||
- name: Acquiring installation shell script
|
||||
ansible.builtin.get_url:
|
||||
|
||||
Reference in New Issue
Block a user