Native YAML (#3596)

pull/18777/head
Fabio Alessandro Locati 8 years ago committed by Matt Clay
parent f4a4492992
commit 951b87492a

@ -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

@ -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 = '''

@ -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):

Loading…
Cancel
Save