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 ⛽🔥🤤

47 lines (40 loc) 1.51 kB
--- - name: Ensure Megabyte Labs configuration directory exists file: mode: 0700 path: "{{ item }}" state: directory loop: - ~/.config - ~/.config/megabytelabs - name: "Check if {{ app_name }} has configuration stored in ~/.config/megabytelabs/dive" stat: path: "~/.config/megabytelabs/dive" register: dive_config - name: "Detect previously installed {{ app_name }} version" command: cat dive args: chdir: ~/.config/megabytelabs changed_when: false register: current_dive_version when: dive_config.stat.exists - name: "Detect the latest {{ app_name }} version" uri: url: https://api.github.com/repos/wagoodman/dive/releases/latest register: dive_latest_release_tag - name: "Determine whether or not the latest version of {{ app_name }} is already installed" set_fact: install_dive: "{{ (current_dive_version.skipped) or \ ((not current_dive_version.skipped) and (current_dive_version.stdout != dive_latest_release_tag.json.tag_name)) }}" - name: "Ensure {{ app_name }} is installed" apt: deb: "https://github.com/wagoodman/dive/releases/download/{{ dive_latest_release_tag.json.tag_name }}/\ dive_{{ dive_latest_release_tag.json.tag_name | replace('v','') }}_linux_amd64.deb" when: install_dive - name: "Save meta information about the version of {{ app_name }} that was installed" copy: dest: ~/.config/megabytelabs/dive mode: 0600 content: | {{ dive_latest_release_tag.json.tag_name }} when: install_dive