UNPKG

@installdoc/ansible-gas-station

Version:

An Ansible playbook that provisions your network with software from GitHub Awesome lists, developed with disaster recovery in mind ⛽🔥🤤

57 lines (54 loc) 1.95 kB
--- - name: Ensure fonts are installed include_role: name: helpers/fontinstall vars: fonts: - nerd-font - font-awesome - name: "Ensure {{ app_name }} is installed" dnf: name: lsd state: present update_cache: "{{ omit if skip_package_cache_update is defined else 'true' }}" when: ansible_distribution == 'Fedora' - name: "Ensure {{ app_name }} is installed" block: - name: Ensure custom facts directory exists file: mode: 0755 path: /etc/ansible/facts.d state: directory - name: "Detect the latest {{ app_name }} version" uri: url: https://api.github.com/repos/Peltoche/lsd/releases/latest register: lsd_latest_release_tag - name: "Determine whether or not the latest version of {{ app_name }} is already installed" set_fact: install_lsd: "{{ (ansible_local.lsd is not defined) or \ ((ansible_local.lsd is defined) and (ansible_local['lsd']['settings']['version'] != lsd_latest_release_tag.json.tag_name)) }}" - name: "Ensure {{ app_name }} is installed" unarchive: src: "https://github.com/Peltoche/lsd/releases/download/{{ lsd_latest_release_tag.json.tag_name }}/\ lsd-{{ lsd_latest_release_tag.json.tag_name }}-x86_64-unknown-linux-musl.tar.gz" dest: /usr/local/bin extra_opts: - --strip-components=1 exclude: - LICENSE - README.md - lsd.1 - autocomplete remote_src: true when: install_lsd - name: "Save meta information about the version of {{ app_name }} that was installed" community.general.ini_file: path: /etc/ansible/facts.d/lsd.fact mode: 0644 section: settings option: version value: "{{ lsd_latest_release_tag.json.tag_name }}" backup: true no_extra_spaces: true when: install_lsd when: ansible_distribution != 'Fedora'