adding tests
- stat doesn't work on remote, need to figure out a workaround
This commit is contained in:
@@ -5,21 +5,27 @@
|
||||
path: "{{ role_path }}/tasks/pkgs/{{ pkg }}.yml"
|
||||
register: stat_pkg
|
||||
|
||||
- name: Dump stat_pkg
|
||||
ansible.builtin.debug:
|
||||
var: stat_pkg
|
||||
|
||||
- name: "Check if specialized configuration exists for {{ pkg }}"
|
||||
when:
|
||||
- stat_pkg.exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ role_path }}/tasks/config/{{ pkg }}.yml"
|
||||
register: stat_config
|
||||
|
||||
- name: Dump stat_config
|
||||
ansible.builtin.debug:
|
||||
var: stat_config
|
||||
|
||||
- name: "Load specialized configuration if it exists for {{ pkg }}"
|
||||
when:
|
||||
- stat_config.exists
|
||||
- stat_config.stat.exists
|
||||
ansible.builtin.include_tasks:
|
||||
file: "config/{{ pkg }}.yml"
|
||||
|
||||
- name: "Add include task for {{ pkg }}"
|
||||
when:
|
||||
- stat_pkg.exists
|
||||
- stat_pkg.stat.exists
|
||||
ansible.builtin.include_tasks:
|
||||
file: "pkgs/{{ pkg }}.yml"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
---
|
||||
- name: Install go packages
|
||||
become: "{{ archive_become }}"
|
||||
environment:
|
||||
GOBIN: "{{ paths.bin }}"
|
||||
PATH: "{{ paths.go }}/bin:$PATH"
|
||||
ansible.builtin.command:
|
||||
creates: "{{ paths.bin }}/{{ pkg.bin }}"
|
||||
cmd:
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
ansible.builtin.include_tasks:
|
||||
file: addpkg.yml
|
||||
|
||||
|
||||
|
||||
- name: Install sys_pkgs list using system package manager
|
||||
become: "{{ sys_pkg_become }}"
|
||||
ansible.builtin.package:
|
||||
@@ -79,9 +77,6 @@
|
||||
loop: "{{ go_pkgs | unique }}"
|
||||
loop_control:
|
||||
loop_var: pkg
|
||||
environment:
|
||||
GOBIN: "{{ paths.bin }}"
|
||||
PATH: "{{ paths.go }}/bin:$PATH"
|
||||
ansible.builtin.include_tasks:
|
||||
file: go.yml
|
||||
|
||||
|
||||
Reference in New Issue
Block a user