Native YAML (#3596)
This commit is contained in:
parent
f4a4492992
commit
951b87492a
3 changed files with 64 additions and 16 deletions
|
@ -62,7 +62,10 @@ options:
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Example bzr checkout from Ansible Playbooks
|
# 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
|
import re
|
||||||
|
|
|
@ -72,30 +72,65 @@ options:
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Set some settings in ~/.gitconfig
|
# Set some settings in ~/.gitconfig
|
||||||
- git_config: name=alias.ci scope=global value=commit
|
- git_config:
|
||||||
- git_config: name=alias.st scope=global value=status
|
name: alias.ci
|
||||||
|
scope: global
|
||||||
|
value: commit
|
||||||
|
|
||||||
|
- git_config:
|
||||||
|
name: alias.st
|
||||||
|
scope: global
|
||||||
|
value: status
|
||||||
|
|
||||||
# Or system-wide:
|
# Or system-wide:
|
||||||
- git_config: name=alias.remotev scope=system value="remote -v"
|
- git_config:
|
||||||
- git_config: name=core.editor scope=global value=vim
|
name: alias.remotev
|
||||||
|
scope: system
|
||||||
|
value: remote -v
|
||||||
|
|
||||||
|
- git_config:
|
||||||
|
name: core.editor
|
||||||
|
scope: global
|
||||||
|
value: vim
|
||||||
|
|
||||||
# scope=system is the default
|
# scope=system is the default
|
||||||
- git_config: name=alias.diffc value="diff --cached"
|
- git_config:
|
||||||
- git_config: name=color.ui value=auto
|
name: alias.diffc
|
||||||
|
value: diff --cached
|
||||||
|
|
||||||
|
- git_config:
|
||||||
|
name: color.ui
|
||||||
|
value: auto
|
||||||
|
|
||||||
# Make etckeeper not complain when invoked by cron
|
# 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
|
# Read individual values from git config
|
||||||
- git_config: name=alias.ci scope=global
|
- git_config:
|
||||||
# scope=system is also assumed when reading values, unless list_all=yes
|
name: alias.ci
|
||||||
- git_config: name=alias.diffc
|
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
|
# 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
|
# 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
|
# 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 = '''
|
RETURN = '''
|
||||||
|
|
|
@ -77,10 +77,20 @@ author: "Phillip Gentry, CX Inc (@pcgentry)"
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Example creating a new service hook. It ignores duplicates.
|
# 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.
|
# 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):
|
def _list(module, hookurl, oauthkey, repo, user):
|
||||||
|
|
Loading…
Reference in a new issue