Skip to content

Commit

Permalink
Merge pull request #1 from octo-technology/bootstrap
Browse files Browse the repository at this point in the history
Bootstrap repo
  • Loading branch information
rrey authored Mar 24, 2020
2 parents 4fcd7f6 + 34ba1d7 commit 921ffa9
Show file tree
Hide file tree
Showing 22 changed files with 997 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI
on:
- pull_request

jobs:
sanity:
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@v1
with:
path: ansible_collections/total/azuread

- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6

- name: Install ansible-base
run: pip install git+https://github.com/ansible-collection-migration/ansible-base.git --disable-pip-version-check

- name: Run sanity tests
run: ansible-test sanity --docker -v --color --python 3.6

integration:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.6"]
container:
image: python:${{ matrix.python_version }}-alpine
steps:

- name: Install requirements on alpine
run: apk add bash git gcc python3-dev libc-dev libffi-dev openssl-dev

- name: Check out code
uses: actions/checkout@v1
with:
path: ansible_collections/total/azuread

- name: Create credentials for the tests
run: tests/gen_creds.sh
env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}

- name: Install ansible-base
run: pip install git+https://github.com/ansible-collection-migration/ansible-base.git --disable-pip-version-check

- name: Install Pyhton deps
run: pip install -r requirements.txt

- name: Run integration tests on Python ${{ matrix.python_version }}
run: ansible-test integration -v --color --retry-on-error --python ${{ matrix.python_version }} --continue-on-error --diff
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,9 @@ dmypy.json

# Pyre type checker
.pyre/


.idea

# ansible-test
tests/output/*
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/azuread-msgraph.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 107 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,107 @@
# azuread-msgraph
# Azure Active Directory Collection for Ansible

![](https://github.com/octo-technology/azuread-msgraph/workflows/CI/badge.svg?branch=master)

This repo hosts the `octo.azuread` Ansible Collection.
The collection includes a variety of Ansible content to help automate the management of Active Directory resources through the **Microsft Graph API**.



## Included content

Click on the name of a plugin or module to view that content's documentation:

- **Connection Plugins**:
- **Filter Plugins**:
- **Inventory Source**:
- **Callback Plugins**:
- **Lookup Plugins**:
- **Modules**:
- azuread_group


## Installation and Usage

### Installing the Collection from Ansible Galaxy

Before using the AzureAD collection, you need to install it with the Ansible Galaxy CLI:

ansible-galaxy collection install octo.azuread

You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format:

```yaml
---
collections:
- name: octo.azuread
version: v0.1.0
```
### Using modules from the Grafana Collection in your playbooks
You can either call modules by their Fully Qualified Collection Namespace (FQCN), like `octo.azuread.azuread_group`, or you can call modules by their short name if you list the `octo.azuread` collection in the playbook's `collections`, like so:

```yaml
---
- hosts: localhost
gather_facts: false
connection: local
collections:
- octo.azuread
tasks:
- name: Create a group with a owner
azuread_group:
name: "{{ azuread_group.name }}"
description: "{{ azuread_group.description }}"
mail_nickname: "{{ azuread_group.mail_nickname }}"
owners:
- "https://graph.microsoft.com/v1.0/users/a802c037-468d-4dca-a21d-f60965f62313"
state: "present"
client_id: "{{ client_id }}"
client_secret: "{{ client_secret }}"
tenant_id: "{{ tenant_id }}"
```

For documentation on how to use individual modules and other content included in this collection, please see the links in the 'Included content' section earlier in this README.

## Testing and Development

If you want to develop new content for this collection or improve what's already here, the easiest way to work on the collection is to clone it into one of the configured [`COLLECTIONS_PATHS`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths), and work on it there.

### Testing with `ansible-test`

The `tests` directory contains configuration for running sanity and integration tests using [`ansible-test`](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html).

You can run the collection's test suites with the commands:

ansible-test sanity --docker -v --color
ansible-test integration --docker -v --color

## Publishing New Versions

The current process for publishing new versions of the Collection is manual, and outside Ansible Galaxy.

1. Ensure `CHANGELOG.md` contains all the latest changes.
2. Update `galaxy.yml` and this README's `requirements.yml` example with the new `version` for the collection.
3. Tag the version in Git and push to GitHub.
4. Run the following commands to build and release the new version on Galaxy:

```
ansible-galaxy collection build
```

Upload the archive as an artifact of the github release.

## License

GNU General Public License v3.0 or later

See LICENCE to see the full text.

## Contributing

Any contribution is welcome and we only ask contributors to:
* Provide *at least* integration tests for any contribution.
* Create an issues for any significant contribution that would change a large portion of the code base.
57 changes: 57 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
### REQUIRED

# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
# underscores or numbers and cannot contain consecutive underscores
namespace: octo

# The name of the collection. Has the same character restrictions as 'namespace'
name: azuread

# The version of the collection. Must be compatible with semantic versioning
version: 0.1.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md

# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- your name <[email protected]>


### OPTIONAL but strongly recommended

# A short summary description of the collection
description: your collection description

# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
license:
- GPL-2.0-or-later

# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
license_file: ''

# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags: []

# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies: {}

# The URL of the originating SCM repository
repository: http://example.com/repository

# The URL to any online docs
documentation: http://docs.example.com

# The URL to the homepage of the collection/project
homepage: http://example.com

# The URL to the collection issue tracker
issues: http://example.com/issue/tracker
31 changes: 31 additions & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Collections Plugins Directory

This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that
is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that
would contain module utils and modules respectively.

Here is an example directory of the majority of plugins currently supported by Ansible:

```
└── plugins
├── action
├── become
├── cache
├── callback
├── cliconf
├── connection
├── filter
├── httpapi
├── inventory
├── lookup
├── module_utils
├── modules
├── netconf
├── shell
├── strategy
├── terminal
├── test
└── vars
```

A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible/2.9/plugins/plugins.html).
Loading

0 comments on commit 921ffa9

Please sign in to comment.