~canonical-ci-engineering/ubuntu-ci-services-itself/ansible

« back to all changes in this revision

Viewing changes to library/files/template

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Harlan Lieberman-Berg, Michael Vogt
  • Date: 2013-11-01 09:40:59 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20131101094059-6w580ocxzqyqzuu3
Tags: 1.3.4+dfsg-1
[ Harlan Lieberman-Berg ]
* New upstream release (Closes: #717777).
  Fixes CVE-2013-2233 (Closes: #714822).
  Fixes CVE-2013-4259 (Closes: #721766).
* Drop fix-ansible-cfg patch.
* Change docsite generation to not expect docs as part of a wordpress install.
* Add trivial patch to fix lintian error with rpm-key script.
* Add patch header information to fix-html-makefile.

[ Michael Vogt ]
* add myself to uploader
* build/ship the module manpages for ansible in the ansible package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# this is a virtual module that is entirely implemented server side
 
2
 
 
3
DOCUMENTATION = '''
 
4
---
 
5
module: template
 
6
short_description: Templates a file out to a remote server.
 
7
description:
 
8
     - Templates are processed by the Jinja2 templating language
 
9
       (U(http://jinja.pocoo.org/docs/)) - documentation on the template
 
10
       formatting can be found in the Template Designer Documentation
 
11
       (U(http://jinja.pocoo.org/docs/templates/)).
 
12
     - "Six additional variables can be used in templates: C(ansible_managed) 
 
13
       (configurable via the C(defaults) section of C(ansible.cfg)) contains a string
 
14
       which can be used to describe the template name, host, modification time of the
 
15
       template file and the owner uid, C(template_host) contains the node name of 
 
16
       the template's machine, C(template_uid) the owner, C(template_path) the
 
17
       relative path of the template, C(template_fullpath) is the absolute path of the 
 
18
       template, and C(template_run_date) is the date that the template was rendered."
 
19
options:
 
20
  src:
 
21
    description:
 
22
      - Path of a Jinja2 formatted template on the local server. This can be a relative or absolute path.
 
23
    required: true
 
24
    default: null
 
25
    aliases: []
 
26
  dest:
 
27
    description:
 
28
      - Location to render the template to on the remote machine.
 
29
    required: true
 
30
    default: null
 
31
  backup:
 
32
    description:
 
33
      - Create a backup file including the timestamp information so you can get
 
34
        the original file back if you somehow clobbered it incorrectly.
 
35
    required: false
 
36
    choices: [ "yes", "no" ]
 
37
    default: "no"
 
38
  validate:
 
39
    description:
 
40
      - validation to run before copying into place
 
41
    required: false
 
42
    default: ""
 
43
    version_added: "1.2"
 
44
  others:
 
45
    description:
 
46
      - all arguments accepted by the M(file) module also work here
 
47
    required: false
 
48
notes:
 
49
  - Since Ansible version 0.9, templates are loaded with C(trim_blocks=True).
 
50
  - 'You can override jinja2 settings by adding a special header to template file. 
 
51
    i.e. C(#jinja2: trim_blocks: False)'
 
52
requirements: []
 
53
author: Michael DeHaan
 
54
'''
 
55
 
 
56
EXAMPLES = '''
 
57
# Example from Ansible Playbooks
 
58
- template: src=/mytemplates/foo.j2 dest=/etc/file.conf owner=bin group=wheel mode=0644
 
59
 
 
60
# Copy a new "sudoers file into place, after passing validation with visudo
 
61
- action: template src=/mine/sudoers dest=/etc/sudoers validate='visudo -cf %s'
 
62
'''