Librarian resource
This commit is contained in:
parent
b24e2a33cd
commit
493fcb1151
6
resources/librarian/actions/remove.yaml
Normal file
6
resources/librarian/actions/remove.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
#XXX: should we remove modules also?
|
||||
- file: path={{config_dir}}/Puppetfile state=absent
|
||||
- shell: gem uninstall librarian-puppet
|
9
resources/librarian/actions/run.yaml
Normal file
9
resources/librarian/actions/run.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
# XXX: check apt package http://packages.ubuntu.com/trusty/ruby/librarian-puppet
|
||||
- shell: gem install librarian-puppet --no-ri --no-rdoc
|
||||
- template:
|
||||
src={{templates_dir}}/Puppetfile
|
||||
dest={{config_dir}}/Puppetfile
|
||||
- shell: librarian-puppet install chdir={{config_dir}}
|
14
resources/librarian/meta.yaml
Normal file
14
resources/librarian/meta.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
id: librarian
|
||||
handler: ansible
|
||||
version: 0.0.1
|
||||
input:
|
||||
modules:
|
||||
schema: [str]
|
||||
value: []
|
||||
reverse: True
|
||||
config_dir:
|
||||
schema: str!
|
||||
value: /etc/puppet
|
||||
forge:
|
||||
schema: str!
|
||||
value: https://forgeapi.puppetlabs.com
|
24
resources/librarian/templates/Puppetfile
Normal file
24
resources/librarian/templates/Puppetfile
Normal file
@ -0,0 +1,24 @@
|
||||
forge "{{forge}}"
|
||||
|
||||
{%- for module in modules %}
|
||||
|
||||
{% if 'type' not in module or module.type == 'forge' -%}
|
||||
mod '{{module.name}}'
|
||||
{%- if 'version' in module -%}
|
||||
, '{{module.version}}'
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if 'type' in module and module.type == 'git' -%}
|
||||
mod '{{module.name}}'
|
||||
{%- if 'url' in module -%}
|
||||
,
|
||||
:git => '{{module.url}}'
|
||||
{%- endif -%}
|
||||
{%- if 'ref' in module -%}
|
||||
,
|
||||
:ref => '{{module.ref}}'
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- endfor -%}
|
Loading…
Reference in New Issue
Block a user