1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Native YAML (#3596)

This commit is contained in:
Fabio Alessandro Locati 2016-12-01 12:30:04 +00:00 committed by Matt Clay
parent f4a4492992
commit 951b87492a
3 changed files with 64 additions and 16 deletions

View file

@ -62,7 +62,10 @@ options:
EXAMPLES = '''
# Example bzr checkout from Ansible Playbooks
- bzr: name=bzr+ssh://foosball.example.org/path/to/branch dest=/srv/checkout version=22
- bzr:
name: 'bzr+ssh://foosball.example.org/path/to/branch'
dest: /srv/checkout
version: 22
'''
import re

View file

@ -72,30 +72,65 @@ options:
EXAMPLES = '''
# Set some settings in ~/.gitconfig
- git_config: name=alias.ci scope=global value=commit
- git_config: name=alias.st scope=global value=status
- git_config:
name: alias.ci
scope: global
value: commit
- git_config:
name: alias.st
scope: global
value: status
# Or system-wide:
- git_config: name=alias.remotev scope=system value="remote -v"
- git_config: name=core.editor scope=global value=vim
- git_config:
name: alias.remotev
scope: system
value: remote -v
- git_config:
name: core.editor
scope: global
value: vim
# scope=system is the default
- git_config: name=alias.diffc value="diff --cached"
- git_config: name=color.ui value=auto
- git_config:
name: alias.diffc
value: diff --cached
- git_config:
name: color.ui
value: auto
# Make etckeeper not complain when invoked by cron
- git_config: name=user.email repo=/etc scope=local value="root@{{ ansible_fqdn }}"
- git_config:
name: user.email
repo: /etc
scope: local
value: 'root@{{ ansible_fqdn }}'
# Read individual values from git config
- git_config: name=alias.ci scope=global
# scope=system is also assumed when reading values, unless list_all=yes
- git_config: name=alias.diffc
- git_config:
name: alias.ci
scope: global
# scope: system is also assumed when reading values, unless list_all=yes
- git_config:
name: alias.diffc
# Read all values from git config
- git_config: list_all=yes scope=global
- git_config:
list_all: yes
scope: global
# When list_all=yes and no scope is specified, you get configuration from all scopes
- git_config: list_all=yes
- git_config:
list_all: yes
# Specify a repository to include local settings
- git_config: list_all=yes repo=/path/to/repo.git
- git_config:
list_all: yes
repo: /path/to/repo.git
'''
RETURN = '''

View file

@ -77,10 +77,20 @@ author: "Phillip Gentry, CX Inc (@pcgentry)"
EXAMPLES = '''
# Example creating a new service hook. It ignores duplicates.
- github_hooks: action=create hookurl=http://11.111.111.111:2222 user={{ gituser }} oauthkey={{ oauthkey }} repo=https://api.github.com/repos/pcgentry/Github-Auto-Deploy
- github_hooks:
action: create
hookurl: 'http://11.111.111.111:2222'
user: '{{ gituser }}'
oauthkey: '{{ oauthkey }}'
repo: 'https://api.github.com/repos/pcgentry/Github-Auto-Deploy'
# Cleaning all hooks for this repo that had an error on the last update. Since this works for all hooks in a repo it is probably best that this would be called from a handler.
- local_action: github_hooks action=cleanall user={{ gituser }} oauthkey={{ oauthkey }} repo={{ repo }}
- github_hooks:
action: cleanall
user: '{{ gituser }}'
oauthkey: '{{ oauthkey }}'
repo: '{{ repo }}'
delegate_to: localhost
'''
def _list(module, hookurl, oauthkey, repo, user):