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

Adjust booleans in source control modules. (#5158)

This commit is contained in:
Felix Fontein 2022-08-24 19:59:56 +02:00 committed by GitHub
parent 35a283918a
commit 675bdef190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 68 additions and 68 deletions

View file

@ -44,7 +44,7 @@ options:
description:
- Whether to encrypt the variable value.
type: bool
default: no
default: false
state:
description:
- Indicates desired state of the variable.

View file

@ -22,12 +22,12 @@ options:
description:
- SSH or HTTP protocol address of the parent branch.
aliases: [ parent ]
required: yes
required: true
type: str
dest:
description:
- Absolute path of where the branch should be cloned to.
required: yes
required: true
type: path
version:
description:
@ -37,11 +37,11 @@ options:
type: str
force:
description:
- If C(yes), any modified files in the working
- If C(true), any modified files in the working
tree will be discarded. Before 1.9 the default
value was C(yes).
value was C(true).
type: bool
default: 'no'
default: false
executable:
description:
- Path to bzr executable to use. If not supplied,
@ -112,7 +112,7 @@ class Bzr(object):
tree since that commit.
'''
if not force and self.has_local_mods():
self.module.fail_json(msg="Local modifications exist in branch (force=no).")
self.module.fail_json(msg="Local modifications exist in branch (force=false).")
return self._command(["revert"], check_rc=True, cwd=self.dest)
def fetch(self):

View file

@ -30,7 +30,7 @@ options:
description:
- List all settings (optionally limited to a given I(scope)).
type: bool
default: 'no'
default: false
name:
description:
- The name of the setting. If no value is supplied, the value will
@ -52,7 +52,7 @@ options:
- This is required when setting config values.
- If this is set to C(local), you must also specify the C(repo) parameter.
- If this is set to C(file), you must also specify the C(file) parameter.
- It defaults to system only when not using I(list_all)=C(yes).
- It defaults to system only when not using I(list_all)=C(true).
choices: [ "file", "local", "global", "system" ]
type: str
state:
@ -123,35 +123,35 @@ EXAMPLES = '''
name: alias.ci
scope: global
- name: Scope system is also assumed when reading values, unless list_all=yes
- name: Scope system is also assumed when reading values, unless list_all=true
community.general.git_config:
name: alias.diffc
- name: Read all values from git config
community.general.git_config:
list_all: yes
list_all: true
scope: global
- name: When list_all is yes and no scope is specified, you get configuration from all scopes
community.general.git_config:
list_all: yes
list_all: true
- name: Specify a repository to include local settings
community.general.git_config:
list_all: yes
list_all: true
repo: /path/to/repo.git
'''
RETURN = '''
---
config_value:
description: When list_all=no and value is not set, a string containing the value of the setting in name
description: When I(list_all=false) and value is not set, a string containing the value of the setting in name
returned: success
type: str
sample: "vim"
config_values:
description: When list_all=yes, a dict containing key/value pairs of multiple configuration settings
description: When I(list_all=true), a dict containing key/value pairs of multiple configuration settings
returned: success
type: dict
sample:

View file

@ -53,7 +53,7 @@ options:
description:
- If C(true), the deploy key will only be able to read repository contents. Otherwise, the deploy key will be able to read and write.
type: bool
default: 'yes'
default: true
state:
description:
- The state of the deploy key.
@ -64,7 +64,7 @@ options:
description:
- If C(true), forcefully adds the deploy key by deleting any existing deploy key with the same public key or title.
type: bool
default: 'no'
default: false
username:
description:
- The username to authenticate with. Should not be set when using personal access token
@ -92,7 +92,7 @@ EXAMPLES = '''
repo: "example"
name: "new-deploy-key"
key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAwXxn7kIMNWzcDfou..."
read_only: yes
read_only: true
username: "johndoe"
password: "supersecretpassword"
@ -102,7 +102,7 @@ EXAMPLES = '''
repository: "example"
name: "new-deploy-key"
key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAwXxn7kIMNWzcDfou..."
force: yes
force: true
username: "johndoe"
password: "supersecretpassword"
state: absent
@ -113,7 +113,7 @@ EXAMPLES = '''
repository: "example"
name: "new-deploy-key"
key: "{{ lookup('file', '~/.ssh/github.pub') }}"
force: yes
force: true
token: "ABAQDAwXxn7kIMNWzcDfo..."
- name: Re-add a deploy key to a GitHub repository but with a different name
@ -142,7 +142,7 @@ EXAMPLES = '''
repo: "example"
name: "new-deploy-key"
key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAwXxn7kIMNWzcDfou..."
read_only: yes
read_only: true
username: "janedoe"
password: "supersecretpassword"
'''

View file

@ -37,11 +37,11 @@ options:
type: str
force:
description:
- The default is C(yes), which will replace the existing remote key
if it's different than C(pubkey). If C(no), the key will only be
- The default is C(true), which will replace the existing remote key
if it's different than C(pubkey). If C(false), the key will only be
set if no key with the given C(name) exists.
type: bool
default: 'yes'
default: true
author: Robert Estelle (@erydo)
'''

View file

@ -59,13 +59,13 @@ options:
draft:
description:
- Sets if the release is a draft or not. (boolean)
type: 'bool'
default: 'no'
type: bool
default: false
prerelease:
description:
- Sets if the release is a prerelease or not. (boolean)
type: bool
default: 'no'
default: false
author:
- "Adrian Moisey (@adrianmoisey)"

View file

@ -101,9 +101,9 @@ EXAMPLES = '''
organization: MyOrganization
name: myrepo
description: "Just for fun"
private: yes
private: true
state: present
force_defaults: no
force_defaults: false
register: result
- name: Delete the repository

View file

@ -46,7 +46,7 @@ options:
description:
- Whether this key can push to the project.
type: bool
default: no
default: false
state:
description:
- When C(present) the deploy key added to the project if it doesn't exist.
@ -73,7 +73,7 @@ EXAMPLES = '''
project: "my_group/my_project"
title: "Jenkins CI"
state: present
can_push: yes
can_push: true
- name: "Remove the previous deploy key from the project"
community.general.gitlab_deploy_key:

View file

@ -49,7 +49,7 @@ options:
description:
- Trigger hook on push events.
type: bool
default: yes
default: true
push_events_branch_filter:
description:
- Branch name of wildcard to trigger hook on push events
@ -59,42 +59,42 @@ options:
description:
- Trigger hook on issues events.
type: bool
default: no
default: false
merge_requests_events:
description:
- Trigger hook on merge requests events.
type: bool
default: no
default: false
tag_push_events:
description:
- Trigger hook on tag push events.
type: bool
default: no
default: false
note_events:
description:
- Trigger hook on note events or when someone adds a comment.
type: bool
default: no
default: false
job_events:
description:
- Trigger hook on job events.
type: bool
default: no
default: false
pipeline_events:
description:
- Trigger hook on pipeline events.
type: bool
default: no
default: false
wiki_page_events:
description:
- Trigger hook on wiki events.
type: bool
default: no
default: false
hook_validate_certs:
description:
- Whether GitLab will do SSL verification when triggering the hook.
type: bool
default: no
default: false
aliases: [ enable_ssl_verification ]
token:
description:
@ -113,9 +113,9 @@ EXAMPLES = '''
project: "my_group/my_project"
hook_url: "https://my-ci-server.example.com/gitlab-hook"
state: present
push_events: yes
tag_push_events: yes
hook_validate_certs: no
push_events: true
tag_push_events: true
hook_validate_certs: false
token: "my-super-secret-token-that-my-ci-server-will-check"
- name: "Delete the previous hook"

View file

@ -58,23 +58,23 @@ options:
- Whether you want to create issues or not.
- Possible values are true and false.
type: bool
default: yes
default: true
merge_requests_enabled:
description:
- If merge requests can be made or not.
- Possible values are true and false.
type: bool
default: yes
default: true
wiki_enabled:
description:
- If an wiki for this project should be available or not.
type: bool
default: yes
default: true
snippets_enabled:
description:
- If creating snippets should be available or not.
type: bool
default: yes
default: true
visibility:
description:
- C(private) Project access must be granted explicitly for each user.

View file

@ -117,8 +117,8 @@ EXAMPLES = '''
value: abc123
- name: SECRET_ACCESS_KEY
value: dassgrfaeui8989
masked: yes
protected: yes
masked: true
protected: true
environment_scope: production
- name: Set or update some CI/CD variables

View file

@ -66,14 +66,14 @@ options:
description:
- Searches only runners available to the user when searching for existing, when false admin token required.
- Mutually exclusive with I(project) since community.general 4.5.0.
default: no
default: false
type: bool
version_added: 2.0.0
active:
description:
- Define if the runners is immediately active after creation.
required: False
default: yes
default: true
type: bool
locked:
description:
@ -100,7 +100,7 @@ options:
description:
- Run untagged jobs or not.
required: False
default: yes
default: true
type: bool
tag_list:
description: The tags that apply to the runner.
@ -135,7 +135,7 @@ EXAMPLES = '''
api_url: https://gitlab.example.com/
api_token: "{{ access_token }}"
description: Docker Machine t1
owned: yes
owned: true
state: absent
- name: Register runner for a specific project

View file

@ -102,17 +102,17 @@ options:
description:
- Require confirmation.
type: bool
default: yes
default: true
isadmin:
description:
- Grant admin privileges to the user.
type: bool
default: no
default: false
external:
description:
- Define external parameter for this user.
type: bool
default: no
default: false
identities:
description:
- List of identities to be added/updated for this user.

View file

@ -20,7 +20,7 @@ options:
repo:
description:
- The repository address.
required: yes
required: true
aliases: [ name ]
type: str
dest:
@ -37,24 +37,24 @@ options:
force:
description:
- Discards uncommitted changes. Runs C(hg update -C). Prior to
1.9, the default was C(yes).
1.9, the default was C(true).
type: bool
default: 'no'
default: false
purge:
description:
- Deletes untracked files. Runs C(hg purge).
type: bool
default: 'no'
default: false
update:
description:
- If C(no), do not retrieve new revisions from the origin repository
- If C(false), do not retrieve new revisions from the origin repository
type: bool
default: 'yes'
default: true
clone:
description:
- If C(no), do not clone the repository if it does not exist locally.
- If C(false), do not clone the repository if it does not exist locally.
type: bool
default: 'yes'
default: true
executable:
description:
- Path to hg executable to use. If not supplied,
@ -77,14 +77,14 @@ EXAMPLES = '''
repo: https://bitbucket.org/user/repo1
dest: /home/user/repo1
revision: stable
purge: yes
purge: true
- name: Get information about the repository whether or not it has already been cloned locally.
community.general.hg:
repo: git://bitbucket.org/user/repo
dest: /srv/checkout
clone: no
update: no
clone: false
update: false
'''
import os
@ -245,7 +245,7 @@ def main():
cleaned = False
if not dest and (clone or update):
module.fail_json(msg="the destination directory must be specified unless clone=no and update=no")
module.fail_json(msg="the destination directory must be specified unless clone=false and update=false")
hg = Hg(module, dest, repo, revision, hg_path)