Skip to content
Permalink
Browse files

Fix the required changes for PR

  • Loading branch information...
LeonardoAndrei committed Oct 3, 2019
1 parent 4ab8cc9 commit ff6f9e00665d650166818d09b2cdabf2d4086435
@@ -38,37 +38,13 @@ tinyproxy__allow: []
# Port number on which this Tinyproxy listens on.
tinyproxy__port: '8888'

# ]]]
# Configuration for other Ansible roles [[[
# -----------------------------------------

# .. envvar:: tinyproxy__ferm__dependent_rules [[[
#
# Configuration for :ref:`debops.ferm` Tinyproxy role.
tinyproxy__ferm__dependent_rules:

- type: 'accept'
dport: [ 'tinyproxy' ]
saddr: '{{ tinyproxy__allow }}'
accept_any: False
weight: '40'
role: 'tinyproxy'

# ]]]
# .. envvar:: tinyproxy__etc_services__dependent_list [[[
#
# Configuration for the :ref:`debops.etc_services` Ansible role.
tinyproxy__etc_services__dependent_list:

- name: 'tinyproxy'
port: '{{ tinyproxy__port }}'

# ]]]
# Tinyproxy configuration file [[[
# --------------------------------

# The variables below define the contents of the
# :file:`/etc/tinyproxy/tinyproxy.conf` configuration file.
# See :ref:`tinyproxy__ref_configuration` for more details.

# .. envvar:: tinyproxy__default_configuration [[[
#
@@ -81,15 +57,6 @@ tinyproxy__default_configuration:

- name: 'User Group'
comment: |
##
## tinyproxy.conf -- tinyproxy daemon configuration file
##
## This example tinyproxy.conf file contains example settings
## with explanations in comments. For decriptions of all
## parameters, see the tinproxy.conf(5) manual page.
##
User/Group: This allows you to set the user and group that will be
used for tinyproxy after the initial binding to the port has been done
as the root user. Either the user or group name or the UID or GID
@@ -499,3 +466,28 @@ tinyproxy__configuration: []
tinyproxy__combined_configuration: '{{ tinyproxy__default_configuration + tinyproxy__configuration }}'

# ]]]
# Configuration for other Ansible roles [[[
# -----------------------------------------

# .. envvar:: tinyproxy__ferm__dependent_rules [[[
#
# Configuration for :ref:`debops.ferm` Tinyproxy role.
tinyproxy__ferm__dependent_rules:

- type: 'accept'
dport: [ 'tinyproxy' ]
saddr: '{{ tinyproxy__allow }}'
accept_any: False
weight: '40'
role: 'tinyproxy'

# ]]]
# .. envvar:: tinyproxy__etc_services__dependent_list [[[
#
# Configuration for the :ref:`debops.etc_services` Ansible role.
tinyproxy__etc_services__dependent_list:

- name: 'tinyproxy'
port: '{{ tinyproxy__port }}'

# ]]]
@@ -18,8 +18,6 @@
template:
src: 'tinyproxy.conf.j2'
dest: '/etc/tinyproxy/tinyproxy.conf'
owner: 'root'
group: 'root'
mode: '0644'
notify: [ 'Restart tinyproxy' ]

@@ -18,4 +18,4 @@ output = loads('''{{ ({
"installed": true
}) | to_nice_json }}''')

print(dumps(output, sort_keys=True, indent=2))
print(dumps(output, sort_keys=True, indent=4))
@@ -1,5 +1,7 @@
# {{ ansible_managed }}

##
## tinyproxy.conf -- tinyproxy daemon configuration file
##
{% for item in tinyproxy__combined_configuration | parse_kv_items %}
{% if item.comment|d() %}
{{ item.comment | regex_replace('\n$','') | comment() }}
@@ -0,0 +1,71 @@
Default variable details
========================

Some of ``debops.tinyproxy`` default variables have more extensive
configuration than simple strings or lists, here you can find documentation and
examples for them.

.. contents::
:local:
:depth: 1


.. _tinyproxy__ref_configuration:

tinyproxy__configuration
------------------------

The ``tinyproxy__*_configuration`` variables define the contents of the
:file:`/etc/tinyproxy/tinyproxy.conf` configuration file. Each variable is a list of YAML
dictionaries. The list entries with the same ``name`` parameter are merged
together; this allows to change specific parameters in the Ansible inventory
without the need to copy over the entire variable contents.

Examples
~~~~~~~~

To see the examples of the configuration, you can look at the
:envvar:`tinyproxy__default_configuration` variable which defines the
:command:`tinyproxy` default configuration set by the role.

Syntax
~~~~~~

Each entry in the list is a YAML dictionary that describes the configuration file in the
:file:`/etc/tinyproxy/tinyproxy.conf`, using specific parameters:

``name``
Required. The filename of the generated configuration file, it should include
a ``.conf`` extension. This parameter is used to merge multiple entries with
the same ``name`` together.

``options``
Optional. A YAML list of :command:`tinyproxy` configuration options defined in
the configuration file. The ``options`` parameters from different
configuration entries are merged together, therefore it's easy to modify
specific parameters without the need to copy the entire value to the
inventory.

Each element of the options list is a YAML dictionary with specific
parameters:

``name``
Required. This parameter defines the option name, and it needs to be unique
in a given configuration file. Parameters from different options lists with
the same ``name`` are merged together when the configuration entries are
merged.

``comment``
Optional. A string or YAML text block with a comment added to a given
option.

``raw``
Optional. Specify the raw :man:`tinyproxy(8)` configuration options as
a string or a YAML text block. You can use this parameter to define
:command:`tinyproxy` options that don't have specific values.

``state``
Optional. If not specified or ``present``, a given option will be included
in the configuration file. If ``absent``, an option will be removed from
the configuration file. If ``comment``, an option will be included in the
configuration file but commented out.
@@ -21,7 +21,7 @@ Example playbook
----------------

If you are using this role without DebOps, here's an example Ansible playbook
that uses the ``debops.influxdb`` role:
that uses the ``debops.tinyproxy`` role:

.. literalinclude:: ../../../../ansible/playbooks/service/tinyproxy.yml
:language: yaml
@@ -11,6 +11,7 @@ Ubuntu host. Tinyproxy is a light-weight HTTP/HTTPS proxy daemon for POSIX opera

getting-started
defaults/main
defaults-detailed

Copyright
---------
@@ -22,4 +23,4 @@ Copyright
mode: rst
ispell-local-dictionary: "american"
End:

0 comments on commit ff6f9e0

Please sign in to comment.
You can’t perform that action at this time.