Skip to content

Commit

Permalink
Added better readme and fixes issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Terence Westphal committed Nov 3, 2016
1 parent fd18fac commit c3dd8cd
Showing 1 changed file with 28 additions and 37 deletions.
65 changes: 28 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,30 @@ Ansible Role: template
A base template for Ansible Roles that can be imported on Ansible Galaxy.

**Note:** The primary use case for this codebase is "Ansible Role Development".
See the Development section below for more info.

Clone this repository into your ansible-playbook environment.

$ git clone https://github.com/terencewestphal/ansible-role-template.git roles/template

Create a Github repository for your new role, for example: `https://github.com/username/ansible-role-template`.

Rename the original repository to `upstream` and add your new remote (Github) repository as the new `origin`.

$ git remote rename origin upstream
$ git remote add origin https://github.com/username/ansible-role-template

Push your commits to the new `origin`

$ git push origin master

To pull in patches from `upstream`, run:

$ git pull upstream master && git push origin master

Don't forget to replace **username** and **template** in these files to reflect your changes to the role!**
- `README.md`
- `meta/main.yml`
- `.travis.yml`

Requirements
------------
Expand All @@ -19,7 +42,7 @@ Installation

Installing roles from Ansible Galaxy:

$ ansible-galaxy install {username}.{rolename}
$ ansible-galaxy install username.template

Dependencies
------------
Expand All @@ -28,7 +51,7 @@ Install all dependencies needed for this role.

$ ansible-galaxy install -r requirements.yml

Required dependencies:
Required dependencies:
- none

Role Variables
Expand All @@ -51,43 +74,11 @@ Testing

Testing on your local machine

$ ansible-playbook roles/{rolename}/tests/test.yml --extra-vars "rolename=roles/{rolename}" --syntax-check
$ ansible-playbook roles/template/tests/test.yml --extra-vars "rolename=roles/template" --syntax-check

Testing with Travis CI

$ ansible-playbook tests/test.yml -i tests/inventory --extra-vars "rolename=ansible-role-{rolename}" --syntax-check

Development
-----------
Clone this repository into your ansible-playbook environment.

$ git clone https://github.com/terencewestphal/ansible-role-template.git roles/{rolename}


Create a Github repository for your new role.
- Stick to this naming convention for your roles: https://github.com/{username}/ansible-role-{rolename}

Rename the original repository to `upstream` and add your new remote (Github) repository as the new `origin`.

$ git remote rename origin upstream
$ git remote add origin https://github.com/terencewestphal/ansible-role-template

Push your commits to the new `origin`

$ git push origin master

To pull in patches from `upstream`, run:

$ git pull upstream master && git push origin master

Tip: Use Git-flow in your cloned role repositories to keep things clean and make `patching from `upstream` much easier.

**Don't forget to replace `{username}` and `{rolename}` in these files to reflect your changes to the role!**
- `README.md`
- `meta/main.yml`
- `.travis.yml`

$ ansible-playbook tests/test.yml -i tests/inventory --extra-vars "rolename=ansible-role-template" --syntax-check

License
-------
Expand Down

1 comment on commit c3dd8cd

@terencewestphal
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong issue number, should be fixing issue #2

Please sign in to comment.