aboutsummaryrefslogtreecommitdiff
path: root/ansible/action_plugins
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-07 22:52:14 +0000
committerGerrit Code Review <review@openstack.org>2018-11-07 22:52:14 +0000
commit0e7697505b99d2d2281f65dda92c5a4c0e6c5dc9 (patch)
tree7de249cc9daae5aaddf6a70cff4f82ae2a8554ef /ansible/action_plugins
parent2e629ea866a4113c0c6be000b506d54fe3f47584 (diff)
parent8ee47ae3a29e8f2a5d227701dac9f7597a26a97d (diff)
downloadkolla-ansible-0e7697505b99d2d2281f65dda92c5a4c0e6c5dc9.tar.gz
kolla-ansible-0e7697505b99d2d2281f65dda92c5a4c0e6c5dc9.zip
Merge "Merge the merge_yaml and merge_config module into one"
Diffstat (limited to 'ansible/action_plugins')
-rw-r--r--ansible/action_plugins/merge_configs.py35
-rwxr-xr-xansible/action_plugins/merge_yaml.py35
2 files changed, 70 insertions, 0 deletions
diff --git a/ansible/action_plugins/merge_configs.py b/ansible/action_plugins/merge_configs.py
index 4377dd8c1..bc5df494e 100644
--- a/ansible/action_plugins/merge_configs.py
+++ b/ansible/action_plugins/merge_configs.py
@@ -15,6 +15,41 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+DOCUMENTATION = '''
+---
+module: merge_configs
+short_description: Merge ini-style configs
+description:
+ - ConfigParser is used to merge several ini-style configs into one
+options:
+ dest:
+ description:
+ - The destination file name
+ required: True
+ type: str
+ sources:
+ description:
+ - A list of files on the destination node to merge together
+ default: None
+ required: True
+ type: str
+author: Sam Yaple
+'''
+
+EXAMPLES = '''
+Merge multiple configs:
+
+- hosts: database
+ tasks:
+ - name: Merge configs
+ merge_configs:
+ sources:
+ - "/tmp/config_1.cnf"
+ - "/tmp/config_2.cnf"
+ - "/tmp/config_3.cnf"
+ dest:
+ - "/etc/mysql/my.cnf"
+'''
import collections
import inspect
diff --git a/ansible/action_plugins/merge_yaml.py b/ansible/action_plugins/merge_yaml.py
index 0bff14dc2..17ccd64e5 100755
--- a/ansible/action_plugins/merge_yaml.py
+++ b/ansible/action_plugins/merge_yaml.py
@@ -15,6 +15,41 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+DOCUMENTATION = '''
+---
+module: merge_yaml
+short_description: Merge yaml-style configs
+description:
+ - PyYAML is used to merge several yaml files into one
+options:
+ dest:
+ description:
+ - The destination file name
+ required: True
+ type: str
+ sources:
+ description:
+ - A list of files on the destination node to merge together
+ default: None
+ required: True
+ type: str
+author: Sean Mooney
+'''
+
+EXAMPLES = '''
+Merge multiple yaml files:
+
+- hosts: localhost
+ tasks:
+ - name: Merge yaml files
+ merge_yaml:
+ sources:
+ - "/tmp/default.yml"
+ - "/tmp/override.yml"
+ dest:
+ - "/tmp/out.yml"
+'''
+
import inspect
import os
import shutil