updating documentation
- giving things a better structure - better documentation with the way things need to be as a standard
This commit is contained in:
22
tasks/helpers/add_repository.yml
Normal file
22
tasks/helpers/add_repository.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
# Helper: external repository
|
||||
---
|
||||
- name: Add copr repository
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
community.general.copr:
|
||||
host: "{{ repo.host | default('copr.fedorainfracloud.org') }}"
|
||||
state: "{{ repo.state | default('enabled') }}"
|
||||
name: "@{{ repo.name }}"
|
||||
include: "{{ repo.include | default(omit) }}"
|
||||
exclude: "{{ repo.exclude | default(omit) }}"
|
||||
|
||||
- name: Add apt ppa
|
||||
when:
|
||||
- ansible_os_family == 'Debian'
|
||||
ansible.builtin.apt_repository:
|
||||
codename: "{{ repo.codename | default(omit) }}"
|
||||
filename: "{{ repo.filename | default(omit) }}"
|
||||
install_python_apt: true
|
||||
repo: "{{ repo.name }}"
|
||||
state: "{{ repo.state | default('present') }}"
|
||||
@@ -1,26 +1,33 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Install appimage {{ pkg }}
|
||||
become: "{{ ext_become }}"
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
block:
|
||||
- name: Ensure appimage path exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ path.appimage }}/{{ appimage_link_name }}"
|
||||
mode: '0755'
|
||||
path: "{{ path_appimage }}/{{ pkg.name }}"
|
||||
mode: "{{ pkg.mode | default('0755') }}"
|
||||
owner: "{{ pkg.owner | default(ansible_user_id) }}"
|
||||
group: "{{ pkg.group | default(ansible_user_gid) }}"
|
||||
state: directory
|
||||
|
||||
- name: Fetch appimage
|
||||
become: "{{ ext_become }}"
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.builtin.get_url:
|
||||
mode: '0755'
|
||||
mode: "{{ pkg.mode | default('0755') }}"
|
||||
owner: "{{ pkg.owner | default(ansible_user_id) }}"
|
||||
group: "{{ pkg.group | default(ansible_user_gid) }}"
|
||||
url: "{{ pkg.url }}"
|
||||
dest: "{{ path_appimage }}/{{ pkg.name }}/{{ pkg.filename }}"
|
||||
decompress: false
|
||||
backup: true
|
||||
url: "{{ appimage_url }}"
|
||||
dest: "{{ path.appimage }}/{{ appimage_link_name }}/{{ appimage_file }}"
|
||||
backup: false
|
||||
|
||||
- name: Link appimage to bin
|
||||
become: "{{ ext_become }}"
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.builtin.file:
|
||||
state: link
|
||||
src: "{{ path.appimage }}/{{ appimage_link_name }}/{{ appimage_file }}"
|
||||
path: "{{ path.bindir }}/{{ appimage_link_name }}"
|
||||
src: "{{ path_appimage }}/{{ pkg.name }}/{{ pkg.filename }}"
|
||||
path: "{{ path_bin }}/{{ pkg.name }}"
|
||||
|
||||
@@ -1,42 +1,48 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Extract archive to given path
|
||||
- name: Ensure requirements met
|
||||
when:
|
||||
- pkg.extract_to is defined
|
||||
- pkg.name is defined
|
||||
- pkg.url is defined
|
||||
block:
|
||||
- name: Ensure directory exists
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.bulitin.file:
|
||||
state: directory
|
||||
path: "{{ pkg.extract_path }}"
|
||||
mode: "{{ pkg.install_prefix_mode | default('0755') }}"
|
||||
owner: "{{ pkg.install_prefix_owner | default(ansible_user_id)}}"
|
||||
group: "{{ pkg.install_prefix_group | default(ansible_user_gid) }}"
|
||||
- name: Extract archive to given path
|
||||
block:
|
||||
- name: Ensure directory exists
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.bulitin.file:
|
||||
state: directory
|
||||
path: "{{ pkg.extract_to }}"
|
||||
mode: "{{ pkg.mode | default('0755') }}"
|
||||
owner: "{{ pkg.owner | default(ansible_user_id)}}"
|
||||
group: "{{ pkg.group | default(ansible_user_gid) }}"
|
||||
|
||||
- name: Download archive to cache
|
||||
ansible.builtin.get_url:
|
||||
dest: "{{ d_cache }}/{{ pkg.archive_name }}"
|
||||
url: "{{ pkg.archive_url }}"
|
||||
checksum: "{{ pkg.archive_checksum | default(omit) }}"
|
||||
decompress: false
|
||||
mode: '0644'
|
||||
- name: Download archive to cache
|
||||
ansible.builtin.get_url:
|
||||
dest: "{{ d_cache }}/{{ pkg.name }}"
|
||||
url: "{{ pkg.url }}"
|
||||
checksum: "{{ pkg.checksum | default(omit) }}"
|
||||
decompress: false
|
||||
mode: '0644'
|
||||
|
||||
- name: Extract archive
|
||||
ansible.builtin.unarchive:
|
||||
dest: "{{ pkg.extract_path }}"
|
||||
src: "{{ d_cache }}/{{ pkg.archive_name }}"
|
||||
remote_src: true
|
||||
include: "{{ pkg.archive_include | default(omit) }}"
|
||||
exclude: "{{ pkg.archive_exclude | default(omit) }}"
|
||||
- name: Extract archive
|
||||
ansible.builtin.unarchive:
|
||||
dest: "{{ pkg.extract_to }}"
|
||||
src: "{{ d_cache }}/{{ pkg.name }}"
|
||||
remote_src: true
|
||||
include: "{{ pkg.include | default(omit) }}"
|
||||
exclude: "{{ pkg.exclude | default(omit) }}"
|
||||
|
||||
- name: Symlink archive files
|
||||
when:
|
||||
- pkg.link_bin is defined
|
||||
- pkg.link_bin | length > 0
|
||||
loop: pkg.link_bin
|
||||
loop_control:
|
||||
loop_var: lnk
|
||||
ansible.builtin.file:
|
||||
state: link
|
||||
path: "{{ lnk.to }}"
|
||||
src: "{{ lnk.from }}"
|
||||
force: "{{ lnk.force | default(omit) }}"
|
||||
- name: Symlink archive files
|
||||
when:
|
||||
- pkg.bins is defined
|
||||
- pkg.bins | length > 0
|
||||
loop: pkg.bins
|
||||
loop_control:
|
||||
loop_var: lnk
|
||||
ansible.builtin.file:
|
||||
state: link
|
||||
path: "{{ lnk.to }}"
|
||||
src: "{{ lnk.from }}"
|
||||
force: "{{ lnk.force | default(omit) }}"
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# vim: set filetype=yaml.ansible
|
||||
---
|
||||
- name: Install cargo {{ pkg }}
|
||||
become: "{{ ext_become }}"
|
||||
environment:
|
||||
RUSTONIG_SYSTEM_LIBONIG: 1
|
||||
- name: Install cargo
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
community.general.cargo:
|
||||
name: "{{ pkg.name | default(pkg) }}"
|
||||
version: "{{ pkg.vers | default(omit) }}"
|
||||
path: "{{ path.cargo | default(path.prefix) }}"
|
||||
locked: "{{ pkg.locked | default(omit) }}"
|
||||
version: "{{ pkg.version | default(omit) }}"
|
||||
locked: "{{ pkg.locked | default(false) }}"
|
||||
path: "{{ install_prefix }}"
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
block:
|
||||
- name: Set build variables
|
||||
ansible.builtin.set_fact:
|
||||
git_path: "{{ d_tempdir.path }}/{{ name }}"
|
||||
git_repo: "{{ repo }}"
|
||||
git_depth: "{{ depth | default(1) }}"
|
||||
git_recursive: "{{ recursive | default(true) }}"
|
||||
git_version: "{{ version | default(omit) }}"
|
||||
git_path: "{{ d_tempdir.path }}/{{ pkg.name }}"
|
||||
git_repo: "{{ pkg.repo }}"
|
||||
git_depth: "{{ pkg.depth | default(1) }}"
|
||||
git_recursive: "{{ pkg.recursive | default(true) }}"
|
||||
git_version: "{{ pkg.version | default(omit) }}"
|
||||
|
||||
- name: Fetch git repo
|
||||
ansible.builtin.include_tasks:
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
- name: Build cargo release
|
||||
ansible.builtin.command:
|
||||
creates: "{{ bin_output }}"
|
||||
chdir: "{{ git_path }}"
|
||||
argv: "{{ [cargo, build] + cargo_build_flags }}"
|
||||
creates: "{{ pkg.bin_output }}"
|
||||
chdir: "{{ pkg.path }}"
|
||||
argv: "{{ [cargo, build] + pkg.build_flags }}"
|
||||
|
||||
- name: Install cargo release
|
||||
block:
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
---
|
||||
- name: Clone git repository
|
||||
ansible.builtin.git:
|
||||
depth: "{{ git_depth | default(1) }}"
|
||||
dest: "{{ git_path }}"
|
||||
force: "{{ git_force | default(true) }}"
|
||||
recursive: "{{ git_recursive | default(true) }}"
|
||||
repo: "{{ git_repo }}"
|
||||
version: "{{ git_version | default(omit) }}"
|
||||
depth: "{{ git.depth | default(1) }}"
|
||||
dest: "{{ git.path }}"
|
||||
force: "{{ git.force | default(true) }}"
|
||||
recursive: "{{ git.recursive | default(true) }}"
|
||||
repo: "{{ git.repo }}"
|
||||
version: "{{ git.version | default(omit) }}"
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Install npm {{ pkg }}
|
||||
become: true
|
||||
- name: Install npm
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
community.general.npm:
|
||||
global: true
|
||||
name: "{{ pkg }}"
|
||||
state: present
|
||||
global: "{{ pkg.global | default(true) }}"
|
||||
name: "{{ pkg.name }}"
|
||||
version: "{{ pkg.version | default('latest') }}"
|
||||
state: "{{ pkg.state | default('present') }}"
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
# Package: air
|
||||
# Description: application auto reload for go
|
||||
# Version: latest
|
||||
# Methods: source (go install)
|
||||
# Helpers: go_install
|
||||
---
|
||||
- name: Configure air # {{{
|
||||
# {{{ Configure air
|
||||
- name: Start air configuration
|
||||
when:
|
||||
- __air_configured is undefined
|
||||
- "'air' not in __configured"
|
||||
block:
|
||||
- name: Set air install method
|
||||
when:
|
||||
@@ -44,6 +50,6 @@
|
||||
ansible.builtin.set_fact:
|
||||
pkg_go: "{{ pkg_go + [air_go_pkg] }}"
|
||||
|
||||
- name: Complete air configuration
|
||||
- name: Finalize air configuration
|
||||
ansible.builtin.set_fact:
|
||||
__air_configured: true
|
||||
__configured: "{{ __configured | combine( { 'air': true } ) }}"
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Set maintainer
|
||||
ansible.builtin.set_fact:
|
||||
ansible_maintainers:
|
||||
- Matthew Stobbs
|
||||
- name: Configure ansible
|
||||
when:
|
||||
- __ansible_configured is undefined or
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Add ansible_ls
|
||||
- name: Configure ansible_ls
|
||||
when:
|
||||
- __ansible_ls_configured is undefined
|
||||
block:
|
||||
@@ -10,9 +10,19 @@
|
||||
ansible.builtin.set_fact:
|
||||
ansible_ls_install_method: "{% if install_method in ansible_ls_install_methods %}{{ install_method }}{% else %}{{ ansible_ls_install_methods[0] }}{% endif %}"
|
||||
|
||||
- name: Append ansible-language-server to pkg_npm
|
||||
- name: Configure ansible_ls source npm installation
|
||||
when:
|
||||
- ansible_ls_install_method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_npm: "{{ pkg_npm + ['@ansible/ansible-language-server'] }}"
|
||||
ansible_npm_pkg:
|
||||
name: '@ansible/ansible-language-server'
|
||||
global: true
|
||||
|
||||
- name: Append ansible-language-server to pkg_npm
|
||||
when:
|
||||
- ansible_ls_install_method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_npm: "{{ pkg_npm + [ansible_npm_pkg] }}"
|
||||
|
||||
- name: Set ansible_ls_configured
|
||||
when:
|
||||
|
||||
@@ -56,11 +56,11 @@
|
||||
- name: Finalize go archive install
|
||||
ansible.builtin.set_fact:
|
||||
go_archive_install:
|
||||
extract_path: "{{ go_extract_path }}"
|
||||
archive_url: "{{ go_archive_url }}"
|
||||
archive_name: "{{ go_archive }}"
|
||||
archive_checksum: "{{ go_archive_sums[go_archive_version][ansible_system][go_arch] }}"
|
||||
link_bin:
|
||||
extract_to: "{{ go_extract_path }}"
|
||||
url: "{{ go_archive_url }}"
|
||||
name: "{{ go_archive }}"
|
||||
checksum: "{{ go_archive_sums[go_archive_version][ansible_system][go_arch] }}"
|
||||
bins:
|
||||
- from: "{{ go_archive_path }}/go"
|
||||
to: "{{ path_go }}"
|
||||
force: true
|
||||
|
||||
Reference in New Issue
Block a user