diff --git a/.travis.yml b/.travis.yml index 3ddbe15..336b460 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ env: - distro: centos7 - distro: fedora27 - distro: ubuntu1604 - - distro: ubuntu1710 + - distro: ubuntu1804 script: # Configure test script so we can run extra tests after playbook is run. diff --git a/README.md b/README.md index bd7e95e..d39190c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Ansible Role: Microsoft Azure CLI -[![Build Status](https://travis-ci.org/brentwg/ansible-role-azure-cli.svg?branch=master)](https://travis-ci.org/brentwg/ansible-role-azure-cli) +[![Build Status](https://travis-ci.org/huxoll/ansible-role-azure-cli.svg?branch=master)](https://travis-ci.org/huxoll/ansible-role-azure-cli) This role installs the Microsoft Azure CLI for Linux. @@ -7,7 +7,7 @@ This role installs the Microsoft Azure CLI for Linux. None. -## Role Variables +## Role Variables Sane and opinionated defaults have been provided for creating YUM and APT repositories. See `defaults/main.yml` for more information. ## Dependencies @@ -17,7 +17,7 @@ None. ## Sample Playbook ``` - hosts: all - + roles: - - brentwg.azure-cli + - huxoll.azure-cli ``` diff --git a/meta/main.yml b/meta/main.yml index c6738cd..4dcecd8 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -2,7 +2,7 @@ dependencies: [] galaxy_info: - author: brentwg + author: huxoll description: This role installs the Microsoft Azure CLI for Linux. company: "None" license: "None" diff --git a/tasks/Debian.yml b/tasks/Debian.yml index b06122e..70365a6 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -1,8 +1,18 @@ --- +- name: Fix broken apt module for Ubuntu 1604 + apt: + name: "{{ item }}" + state: present + with_items: + - python-simplejson + - aptitude + - apt-transport-https + when: ansible_os_family == 'Debian' + - name: Import the APT repo key (Debian) apt_key: - keyserver: "{{ apt_key_server }}" - id: "{{ apt_key_id }}" + url: "{{ repo_key_url }}" + state: present - name: Create the APT repository (Debian) apt_repository: @@ -14,3 +24,4 @@ apt: name: "{{ azure_package_name }}" update_cache: yes + when: not ansible_check_mode diff --git a/tasks/MacOSX.yml b/tasks/MacOSX.yml new file mode 100644 index 0000000..baedb9d --- /dev/null +++ b/tasks/MacOSX.yml @@ -0,0 +1,4 @@ +--- +- name: Install azure client using Homebrew on OSX + command: brew install {{ azure_package_name }} + when: ansible_distribution == "MacOSX" diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index 14bbf91..61f7c2f 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -11,4 +11,4 @@ - name: Install the application package (RedHat) package: name: "{{ azure_package_name }}" - state: present + state: latest diff --git a/tasks/main.yml b/tasks/main.yml index 69717c9..f97ad2c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,7 @@ --- # Task Configuration - name: Include OS-specific tasks - include_tasks: "{{ item }}" + include_tasks: "{{ os_tasks }}" with_first_found: - files: - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml" @@ -9,3 +9,5 @@ - "{{ ansible_distribution }}.yml" - "{{ ansible_os_family }}.yml" skip: true + loop_control: + loop_var: os_tasks diff --git a/tests/README.md b/tests/README.md index d7fe8bc..c9fe656 100644 --- a/tests/README.md +++ b/tests/README.md @@ -6,7 +6,7 @@ To run the test playbook(s) in this directory: 1. Install and start Docker. 1. Download the test shim (see .travis.yml file for the URL) into `tests/test.sh`: -`wget -O tests/test.sh https://gist.github.com/brentwg/64f90bdda32a51360f71558d3171fcbb/raw/` +`wget -O tests/test.sh https://gist.githubusercontent.com/huxoll/a38456caf7337c9831998facb5ca3e8b/raw/41bdd63e6eb4b09a08b7355e42e0e1eea5f6bae6/test.sh` 1. Make the test shim executable: `chmod +x tests/test.sh`. 1. Run (from the role's root directory) `distro=[distro] playbook=[playbook] ./tests/test.sh` diff --git a/tests/test.yml b/tests/test.yml index 9d402ab..b852711 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -6,16 +6,6 @@ apt: update_cache=yes cache_valid_time=600 when: ansible_os_family == 'Debian' - - name: Fix broken apt module for Ubuntu 1604 - apt: - name: "{{ item }}" - state: present - with_items: - - python-simplejson - - aptitude - - apt-transport-https - when: ansible_os_family == 'Debian' - roles: - role_under_test