Skip to content

Commit

Permalink
Merge pull request #5 from cytopia/release-v0.5.0
Browse files Browse the repository at this point in the history
Rename Ansible role according to Galaxy standards
  • Loading branch information
cytopia authored May 5, 2019
2 parents a36e4a3 + cf0eb6e commit 0d97cbb
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ before_script:
###
script:
- if [ "${check}" = "ansible-galaxy" ]; then
ansible-galaxy install cytopia.aws-account-match;
ansible-galaxy install cytopia.aws_account_match;
elif [ "${check}" = "syntax-check" ]; then
ansible-playbook tests/play_ok.yml -i tests/inventory --syntax-check;
ansible-playbook tests/play_fail.yml -i tests/inventory --syntax-check;
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Ansible AWS account match


The `aws-account-match` role let's you define one or more AWS accounts and ensures your playbook
The `aws_account_match` role let's you define one or more AWS accounts and ensures your playbook
is only provisioned against those accounts.

Include this role at the very top of any AWS relatated playbooks and it will act as a safeguard
by immediately aborting the whole play in case you are logged in with the wrong AWS account.

Boto profiles and environment variables are both supported.

[![Build Status](https://travis-ci.org/cytopia/ansible-role-aws-account-match.svg?branch=master)](https://travis-ci.org/cytopia/ansible-role-aws-account-match)
[![Ansible Galaxy](https://img.shields.io/ansible/role/d/24913.svg)](https://galaxy.ansible.com/cytopia/aws-account-match/)
[![Release](https://img.shields.io/github/release/cytopia/ansible-role-aws-account-match.svg)](https://github.com/cytopia/ansible-role-aws-account-match/releases)
[![Build Status](https://travis-ci.org/cytopia/ansible-role-aws_account_match.svg?branch=master)](https://travis-ci.org/cytopia/ansible-role-aws_account_match)
[![Ansible Galaxy](https://img.shields.io/ansible/role/d/24913.svg)](https://galaxy.ansible.com/cytopia/aws_account_match/)
[![Release](https://img.shields.io/github/release/cytopia/ansible-role-aws_account_match.svg)](https://github.com/cytopia/ansible-role-aws_account_match/releases)

---

Expand All @@ -24,16 +24,16 @@ Ensure [aws-cli](https://docs.aws.amazon.com/cli/latest/userguide/installing.htm
$ pip install awscli
```

Either use [Ansible Galaxy](https://galaxy.ansible.com/cytopia/aws-account-match) to install the role:
Either use [Ansible Galaxy](https://galaxy.ansible.com/cytopia/aws_account_match) to install the role:

```bash
$ ansible-galaxy install cytopia.aws-account-match
$ ansible-galaxy install cytopia.aws_account_match
```

Or git clone it into your roles directory

```bash
$ git clone https://github.com/cytopia/ansible-role-aws-account-match /path/to/ansible/roles
$ git clone https://github.com/cytopia/ansible-role-aws_account_match /path/to/ansible/roles
```

## Variables
Expand Down Expand Up @@ -64,7 +64,7 @@ $ git clone https://github.com/cytopia/ansible-role-aws-account-match /path/to/a
---
- hosts: all
roles:
- aws-account-match # <- make sure it is the first
- aws_account_match # <- make sure it is the first
- aws-do-this
- aws-do-that
- aws-more-work
Expand Down Expand Up @@ -94,7 +94,7 @@ $ ansible-playbook playbook.yml -e profile=testing
```

```
TASK [aws-account-match : ensure current account matched any of all allowed accounts] **************************
TASK [aws_account_match : ensure current account matched any of all allowed accounts] **************************
fatal: [infrastructure]: FAILED! => {
"assertion": "_aws_account_match_number.stdout | string in aws_account_match_allowed_accounts | map('string') | list",
"changed": false,
Expand All @@ -103,7 +103,7 @@ fatal: [infrastructure]: FAILED! => {
}
```
##### Run without aws-account-match
##### Run without aws_account_match
You can also skip the whole role in case you need to test without account validation
via its pre-defined tags:
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ galaxy_info:
company: cytopia
license: MIT
description: Ansible role that let's you define one or more AWS accounts and ensures your playbook is only provisioned against those accounts.
role_name: aws-account-match
role_name: aws_account_match
min_ansible_version: 2.4
platforms:
- name: EL
Expand Down
16 changes: 8 additions & 8 deletions tests/play_fail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
vars:
aws_account_match_allowed_account: 12345
roles:
- ansible-role-aws-account-match
- ansible-role-aws_account_match
tags:
- aws-account-match
- aws_account_match

- hosts: all
connection: local
vars:
aws_account_match_allowed_accounts: [012345, 123456, 234567]
roles:
- ansible-role-aws-account-match
- ansible-role-aws_account_match
tags:
- aws-account-match
- aws_account_match

###
### With boto profile
Expand All @@ -32,16 +32,16 @@
aws_account_match_allowed_account: 12345
aws_account_match_profile: playground
roles:
- ansible-role-aws-account-match
- ansible-role-aws_account_match
tags:
- aws-account-match
- aws_account_match

- hosts: all
connection: local
vars:
aws_account_match_allowed_accounts: [012345, 123456, 234567]
aws_account_match_profile: playground
roles:
- ansible-role-aws-account-match
- ansible-role-aws_account_match
tags:
- aws-account-match
- aws_account_match
16 changes: 8 additions & 8 deletions tests/play_ok.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
vars:
aws_account_match_allowed_account: 12345
roles:
- ansible-role-aws-account-match
- ansible-role-aws_account_match
tags:
- aws-account-match
- aws_account_match

- hosts: all
connection: local
vars:
aws_account_match_allowed_accounts: [01234, 12345, 23456]
roles:
- ansible-role-aws-account-match
- ansible-role-aws_account_match
tags:
- aws-account-match
- aws_account_match

###
### With boto profile
Expand All @@ -32,16 +32,16 @@
aws_account_match_allowed_account: 12345
aws_account_match_profile: playground
roles:
- ansible-role-aws-account-match
- ansible-role-aws_account_match
tags:
- aws-account-match
- aws_account_match

- hosts: all
connection: local
vars:
aws_account_match_allowed_accounts: [01234, 12345, 23456]
aws_account_match_profile: playground
roles:
- ansible-role-aws-account-match
- ansible-role-aws_account_match
tags:
- aws-account-match
- aws_account_match

0 comments on commit 0d97cbb

Please sign in to comment.