Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to accommodate new signing key from Microsoft, some Debian issues. #3

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 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.

## Requirements

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
Expand All @@ -17,7 +17,7 @@ None.
## Sample Playbook
```
- hosts: all

roles:
- brentwg.azure-cli
- huxoll.azure-cli
```
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 13 additions & 2 deletions tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -14,3 +24,4 @@
apt:
name: "{{ azure_package_name }}"
update_cache: yes
when: not ansible_check_mode
4 changes: 4 additions & 0 deletions tasks/MacOSX.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: Install azure client using Homebrew on OSX
command: brew install {{ azure_package_name }}
when: ansible_distribution == "MacOSX"
2 changes: 1 addition & 1 deletion tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
- name: Install the application package (RedHat)
package:
name: "{{ azure_package_name }}"
state: present
state: latest
4 changes: 3 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
# Task Configuration
- name: Include OS-specific tasks
include_tasks: "{{ item }}"
include_tasks: "{{ os_tasks }}"
with_first_found:
- files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
skip: true
loop_control:
loop_var: os_tasks
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
10 changes: 0 additions & 10 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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