54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
# Package: air
|
|
# Description: application auto reload for go
|
|
# Version: latest
|
|
# Methods:
|
|
# - source (go install)
|
|
# Helpers: go_install
|
|
---
|
|
# {{{ Configure air
|
|
- name: Start air configuration
|
|
when:
|
|
- "'air' not in __configured"
|
|
block:
|
|
- name: Set air install method
|
|
when:
|
|
- air_install_method is undefined
|
|
ansible.builtin.set_fact:
|
|
air_install_method: "{{ install_method if install_method in air.install_methods else air.install_methods[0] }}"
|
|
|
|
- name: Set air build facts
|
|
when:
|
|
- air_install_method == 'source'
|
|
block:
|
|
- name: Set air install package
|
|
ansible.builtin.set_fact:
|
|
air_go_pkg:
|
|
url: "{{ air_install_url }}@{{ air_version }}"
|
|
bin: "{{ path_bin }}/air"
|
|
# }}}
|
|
# {{{ air build and install steps
|
|
- name: Append air to pkg_go
|
|
when:
|
|
- air_install_method == 'source'
|
|
block:
|
|
- name: Clean existing air install
|
|
when:
|
|
- clean_install
|
|
ansible.builtin.set_fact:
|
|
pkg_clean: "{{ pkg_clean + air.install_files }}"
|
|
|
|
- name: Configure pkg dependencies
|
|
loop: "{{ air.pkg_deps }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks: "pkgs/{{ pkg }}.yml"
|
|
|
|
- name: Add air to install list
|
|
ansible.builtin.set_fact:
|
|
pkg_go: "{{ pkg_go + [air_go_pkg] }}"
|
|
# }}}
|
|
- name: Finalize air configuration
|
|
ansible.builtin.set_fact:
|
|
__configured: "{{ __configured | combine( { 'air': true } ) }}"
|