Prechádzať zdrojové kódy

initial working version

Chris Mague 7 rokov pred
commit
62fcb8e507

+ 18 - 0
cookiecutter.json

@@ -0,0 +1,18 @@
+{
+  "full_name": "Chris Mague",
+  "email": "github@mague.com",
+  "role_name": "testrole",
+  "github_user": "maguec",
+  "repo_name": "ansible-role",
+  "short_description": "description goes here",
+  "release_date": "2017-10-12",
+  "year": "2016",
+  "version": "0.1.0",
+  "min_ansible_version": "2.4",
+  "allow_duplicates": "no",
+  "galaxy_tags": "foo,bar,baz",
+  "dependencies": "foo,bar,baz",
+  "target_os": "Ubuntu",
+  "target_os_version": "xenial64",
+  "company_name": "Shokunin Consulting LLC"
+}

+ 18 - 0
{{cookiecutter.role_name}}/Vagrantfile

@@ -0,0 +1,18 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure("2") do |config|
+
+  config.vm.box = "{{ cookiecutter.target_os|lower}}/{{ cookiecutter.target_os_version }}"
+  
+  ENV['ANSIBLE_ROLES_PATH'] = "#{File.dirname(__FILE__)}/.."
+
+  config.vm.provision "shell",
+    inline: "DEBIAN_FRONTEND=noninteractive sudo apt-get -y install python"
+
+  config.vm.provision "ansible" do |ansible|
+    ansible.playbook       = "tests/test-playbook.yml"
+    ansible.sudo           = "true"
+  end
+
+end

+ 2 - 0
{{cookiecutter.role_name}}/defaults/main.yml

@@ -0,0 +1,2 @@
+---
+#defaults for {{cookiecutter.role_name}}

+ 1 - 0
{{cookiecutter.role_name}}/files/README.md

@@ -0,0 +1 @@
+##files for {{cookiecutter.role_name}} go in this directory

+ 2 - 0
{{cookiecutter.role_name}}/handlers/main.yml

@@ -0,0 +1,2 @@
+---
+#handlers for {{cookiecutter.role_name}}

+ 52 - 0
{{cookiecutter.role_name}}/meta/main.yml

@@ -0,0 +1,52 @@
+---
+galaxy_info:
+  author: {{cookiecutter.full_name}}
+  description: {{ cookiecutter.short_description }}
+  company: {{ cookiecutter.company_name }}
+
+  min_ansible_version: {{cookiecutter.min_ansible_version}}
+
+  # If this a Container Enabled role, provide the minimum Ansible Container version.
+  # min_ansible_container_version:
+
+  # Optionally specify the branch Galaxy will use when accessing the GitHub
+  # repo for this role. During role install, if no tags are available,
+  # Galaxy will use this branch. During import Galaxy will access files on
+  # this branch. If Travis integration is configured, only notifications for this
+  # branch will be accepted. Otherwise, in all cases, the repo's default branch
+  # (usually master) will be used.
+  #github_branch:
+
+  #
+  # platforms is a list of platforms, and each platform has a name and a list of versions.
+  #
+  platforms:
+  - name: {{ cookiecutter.target_os }}
+    versions:
+    - all
+  #   - 25
+  # - name: SomePlatform
+  #   versions:
+  #   - all
+  #   - 1.0
+  #   - 7
+  #   - 99.99
+
+    {% if cookiecutter.galaxy_tags == "" %}
+  galaxy_tags: []
+    {% else %}
+  galaxy_tags:
+    {% for tag in  cookiecutter.galaxy_tags.split(',') -%}
+    - {{ tag }}
+    {% endfor -%}
+    {% endif %}
+
+
+    {% if cookiecutter.dependencies == "" %}
+  dependencies: []
+    {% else %}
+  dependencies:
+    {% for tag in  cookiecutter.dependencies.split(',') -%}
+    - {{ tag }}
+    {% endfor -%}
+    {% endif %}

+ 2 - 0
{{cookiecutter.role_name}}/tasks/configure.yaml

@@ -0,0 +1,2 @@
+---
+# configure tasks for {{cookiecutter.role_name}}

+ 2 - 0
{{cookiecutter.role_name}}/tasks/install.yaml

@@ -0,0 +1,2 @@
+---
+# install tasks for {{cookiecutter.role_name}}

+ 5 - 0
{{cookiecutter.role_name}}/tasks/main.yml

@@ -0,0 +1,5 @@
+---
+#tasks for {{cookiecutter.role_name}}
+- include_tasks: install.yaml
+- include_tasks: configure.yaml
+- include_tasks: services.yaml

+ 2 - 0
{{cookiecutter.role_name}}/tasks/services.yaml

@@ -0,0 +1,2 @@
+---
+# services tasks for {{cookiecutter.role_name}}

+ 1 - 0
{{cookiecutter.role_name}}/templates/README.md

@@ -0,0 +1 @@
+##templates for {{cookiecutter.role_name}} go in this directory

+ 2 - 0
{{cookiecutter.role_name}}/tests/inventory

@@ -0,0 +1,2 @@
+localhost
+

+ 11 - 0
{{cookiecutter.role_name}}/tests/test-playbook.yml

@@ -0,0 +1,11 @@
+---
+
+- hosts: all
+  become: yes
+  become_method: sudo
+  become_user: root
+  gather_facts: yes
+
+  roles:
+    - {{ cookiecutter.role_name }}
+

+ 5 - 0
{{cookiecutter.role_name}}/tests/test.yml

@@ -0,0 +1,5 @@
+---
+- hosts: localhost
+  remote_user: root
+  roles:
+    - {{cookiecutter.role_name}}

+ 2 - 0
{{cookiecutter.role_name}}/vars/main.yml

@@ -0,0 +1,2 @@
+---
+#vars for {{cookiecutter.role_name}}