diff --git a/generate.yml b/generate.yml index 2bf4e6f..70c58eb 100755 --- a/generate.yml +++ b/generate.yml @@ -18,7 +18,7 @@ file: "{{ role_path }}/meta/main.yml" name: meta - - name: see if meta/version.yml exists + - name: check meta/version.yml stat: path: "{{ role_path }}/meta/version.yml" register: versionymlstat @@ -29,7 +29,7 @@ register: versionyml when: - versionymlstat.stat.exists | bool - - name: see if meta/exception.yml exists + - name: check meta/exception.yml stat: path: "{{ role_path }}/meta/exception.yml" register: exceptionymlstat @@ -41,12 +41,12 @@ when: - exceptionymlstat.stat.exists | bool - - name: see if meta/logo.png exists + - name: check meta/logo.png stat: path: "{{ role_path }}/meta/logo.png" register: logo - - name: see if meta/preferences.yml exists + - name: check meta/preferences.yml stat: path: "{{ role_path }}/meta/preferences.yml" register: preferencesymlstat @@ -57,7 +57,7 @@ when: - preferencesymlstat.stat.exists | bool - - name: see if defaults/main.yml exists + - name: check defaults/main.yml stat: path: "{{ role_path }}/defaults/main.yml" register: defaultsmainyml @@ -69,7 +69,7 @@ when: - defaultsmainyml.stat.exists | bool - - name: check if requirements.yml exists + - name: cehck requirements.yml stat: path: "{{ role_path }}/requirements.yml" register: check_requirements @@ -93,7 +93,7 @@ src: "{{ role_path }}/molecule/default/playbook.yml" register: example - - name: check if molecule/default/prepare.yml exists + - name: check molecule/default/prepare.yml stat: path: "{{ role_path }}/molecule/default/prepare.yml" register: check_prepare @@ -105,7 +105,7 @@ when: - check_prepare.stat.exists | bool - - name: see if molecule/default/verify.yml exists + - name: check molecule/default/verify.yml stat: path: "{{ role_path }}/molecule/default/verify.yml" register: verify @@ -117,14 +117,14 @@ when: - verify.stat.exists | bool - - name: generate modules list + - name: load modules command: "{{ playbook_dir }}/scripts/modules.sh" args: chdir: "{{ role_path }}" register: modules changed_when: no - - name: load ansible galaxy_id + - name: load galaxy_id shell: "ansible-galaxy info robertdebock.{{ role_name }} | grep ' id: ' | awk '{print $NF}'" register: galaxy_id changed_when: no @@ -151,9 +151,6 @@ src: "{{ playbook_dir }}/files/{{ item.source }}" dest: "{{ role_path }}/{{ item.dest | default(item.source) }}" with_items: - - source: CONTRIBUTING.md - - source: ansible-lint - dest: .ansible-lint - source: bug_report.md dest: .github/ISSUE_TEMPLATE/bug_report.md - source: feature_request.md @@ -166,6 +163,8 @@ src: "{{ playbook_dir}}/templates/{{ item.source }}.j2" dest: "{{ role_path }}/{{ item.dest | default (item.source) }}" with_items: + - source: ansible-lint + dest: .ansible-lint - source: tox.ini - source: settings.yml dest: .github/settings.yml @@ -175,6 +174,8 @@ - source: travis.yml dest: .travis.yml - source: molecule.yml + dest: molecule/default/molecule.yml - source: README.md + - source: CONTRIBUTING.md loop_control: label: "{{ item.source }}" diff --git a/templates/CONSTRIBUTING.md.j2 b/templates/CONSTRIBUTING.md.j2 new file mode 100644 index 0000000..7331a34 --- /dev/null +++ b/templates/CONSTRIBUTING.md.j2 @@ -0,0 +1,74 @@ +# Please contribute + +You can really make a difference by: + +- [Making an issue](https://help.github.com/articles/creating-an-issue/). A well described issue helps a lot. (Have a look at the [known issues](https://github.com/search?q=user%3Arobertdebock+is%3Aissue+state%3Aopen).) +- [Making a pull request](https://services.github.com/on-demand/github-cli/open-pull-request-github) when you see the error in code. + +I'll try to help and take every contribution seriously. + +It's a great opportunity for me to learn how you use the role and also an opportunity to get into the habit of contributing to open source software. + +## Step by step + +Here is how you can help, a lot of steps are related to GitHub, not specifically my roles. + +### 1. Make an issue. + +When you spot an issue, [create an issue](https://github.com/{{ github_namespace }}/{{ role_name }}/issues). + +Making the issue help me and others to find similar problems in the future. + +### 2. Fork the project. + +On the top right side of [the repository on GitHub](https://github.com/{{ github_namespace }}/{{ role_name }}), click `fork`. This copies everything to your GitHub namespace. + +### 3. Make the changes + +In you own GitHub namespace, make the required changes. + +I typically do that by cloning the repository (in your namespace) locally: + +``` +git clone git@github.com:YOURNAMESPACE/{{ role_name }}.git +``` + +Now you can start to edit on your laptop. + +### 4. Optionally: test your changes + +Install [molecule](https://molecule.readthedocs.io/en/stable/) and [Tox](https://tox.readthedocs.io/): + +``` +pip install molecule tox +``` + +And run `molecule test`. If you want to test a specific distribution, set `image` and optionally `tag`: + +``` +image=centos tag=7 molecule test +``` + +Once it start to work, you can test multiple version of Ansible: + +``` +image=centos tag=7 tox +``` + +### 6. Optionally: Regenerate all dynamic content + +You can use [Ansible Generator](https://github.com/robertdebock/ansible-generator) to regenerate all dynamic content. + +If you don't do it, I'll do it later for you. + +### 7. Make a pull request + +[GitHub](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) on pull requests. + +In the comment-box, you can [refer to the issue number](https://help.github.com/en/github/writing-on-github/autolinked-references-and-urls) by using #123, where 123 is the issue number. + +### 8. Wait + +Now I'll get a message that you've added some code. Thank you, really. + +CI starts to test your changes. You can follow the progress on Travis.