-
Notifications
You must be signed in to change notification settings - Fork 14
Coding Guidelines
Ivan Mincik edited this page Dec 5, 2015
·
12 revisions
Don't use TABs anymore !!! We are currently in state, when all tabs will be replaced with four spaces.
- role-name
- files
- static - applications source code, icons, themes, menu files (*.desktop, *.directory)
- scripts - scripts executed by Ansible tasks (script module)
- handlers - handlers in one main.yml file
- tasks - tasks in one main.yml file
- templates - configuration files and other files which does not fit in files
- vars - variables in one main.yml file
- files
Use GISLAB_PATH_TMP for storing temporary files during installation and GISLAB_PATH_TEST_TMP during tests. These directories will be automatically removed when installation/test is finished.
- name: multi line with yaml dict
file:
path: /tmp/foo
state: absent
With the yaml 'folded' style, anything in a new line (and indented) below a > is essentially a single string that has been wrapped. New line chars are not preserved unless the line is further indented or is an empty line.
- name: using folded style to insert content
copy:
dest: /tmp/foo
content: >
this is a string
that will be one
line in the file
- name: using literal style to insert content - useful for cert files
copy:
dest: /tmp/foo
content: |
this is a string
that will have
new lines preserved
# vim: set ts=8 sts=2 sw=2 et:
# vim: set ts=8 sts=4 sw=4 et:
# vim: set ts=8 sts=4 sw=4 et: