From 29daecff2c31d7ffe9b936510061c33e75ffeb92 Mon Sep 17 00:00:00 2001 From: Sylvain Mougenot Date: Wed, 4 Apr 2018 10:24:32 +0200 Subject: [PATCH 1/3] solve deprecation warning --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 38e1c85..4f1d67c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,7 +3,7 @@ - name: pip install awscli pip: name=awscli state=latest - sudo: yes + become: yes - name: enable tab completion for awscli lineinfile: From 7d18f034a31563781c50e91baf32ddd930496c79 Mon Sep 17 00:00:00 2001 From: Sylvain Mougenot Date: Wed, 4 Apr 2018 10:24:43 +0200 Subject: [PATCH 2/3] add tests --- .gitignore | 15 +++++++++++++++ .travis.yml | 12 ++++++++++++ tests/inventory | 1 + tests/test.yml | 5 +++++ 4 files changed, 33 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 tests/inventory create mode 100644 tests/test.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..91751f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Created by .ignore support plugin (hsz.mobi) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +out/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..40c0fc7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +--- +language: python +python: "2.7" +sudo: required +install: + - pip install ansible + - ansible --version + - printf '[defaults]\nroles_path=../' > ansible.cfg +script: + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/tests/inventory @@ -0,0 +1 @@ +localhost diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..be32b5a --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - ansible-awscli From 147419585aa8154dc35d2c82caa30ef1ce497fbf Mon Sep 17 00:00:00 2001 From: Sylvain Mougenot Date: Wed, 4 Apr 2018 10:46:53 +0200 Subject: [PATCH 3/3] fix Galaxy integration --- README.md | 20 +++++++------------- meta/main.yml | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 285dd82..495772c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ Ansible Role for AWSCLI ============================== -This is an Ansible role for awscli: https://github.com/aws/aws-cli. This role installs awscli using pip, sets up awscli's config file, and also enables auto completion for awscli commands. +This is an Ansible role for installing awscli: https://github.com/aws/aws-cli. +This role installs awscli using pip, sets up awscli's config file, and also enables auto completion for awscli commands. Requirements ------------ @@ -11,28 +12,21 @@ pip (python-pip on Ubuntu/Debian) needs to be installed for this role to work. Role Variables -------------- -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. +* awscli_user: ubuntu +* awscli_group: ubuntu +* awscli_user_home: /home/ubuntu Dependencies ------------ -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. +None Example Playbook ---------------- -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } +See test/test.yaml License ------- BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/meta/main.yml b/meta/main.yml index c5c362c..a2626bf 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,8 +1,8 @@ --- galaxy_info: - author: your name - description: - company: your company (optional) + author: Sylvain Mougenot + description: role for installing awscli (fork from hyao/ansible-awscli to fix deprecation) +# company: your company (optional) # Some suggested licenses: # - BSD (default) # - MIT @@ -11,19 +11,19 @@ galaxy_info: # - Apache # - CC-BY license: license (GPLv2, CC-BY, etc) - min_ansible_version: 1.2 + min_ansible_version: 2.4 # # Below are all platforms currently available. Just uncomment # the ones that apply to your role. If you don't see your # platform on this list, let us know and we'll get it added! # - #platforms: - #- name: EL - # versions: + platforms: + - name: EL + versions: # - all # - 5 - # - 6 - # - 7 + - 6 + - 7 #- name: GenericUNIX # versions: # - all @@ -65,8 +65,8 @@ galaxy_info: # - 9.1 # - 9.1 # - 9.2 - #- name: Ubuntu - # versions: + - name: Ubuntu + versions: # - all # - lucid # - maverick @@ -76,7 +76,7 @@ galaxy_info: # - quantal # - raring # - saucy - # - trusty + - trusty #- name: SLES # versions: # - all