Example incorrect: server_url is required argument (#63670)

##### SUMMARY
The example "Delete GitLab Group" does not work.

- name: "Delete GitLab Group"
  gitlab_group:
    api_url: https://gitlab.example.com/
    api_token: "{{ access_token }}"
    validate_certs: False
    name: my_first_group
    state: absent

It errors with: 
fatal: [myhost.mydomain.com -> localhost]: FAILED! => {"changed": false, "msg": "missing required arguments: server_url"}

If you provide server_url and api_url, it complains that they are mutually exclusive:
fatal: [myhost.mydomain.com -> localhost]: FAILED! => {"changed": false, "msg": "parameters are mutually exclusive: api_url|server_url"}

This means there is no logical path in the use of the module where api_url can be specified without resulting in at least one of these fatal errors. I suggest adjusting the examples in the meantime, then changing the module to move away from the soon-to-be deprecated server_url parameter, removing it as a required argument.

This likely applies to all Examples, so this change proposes at least putting in the required parameter in the examples.

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
This commit is contained in:
herpus-derpus 2019-10-18 12:34:00 +01:00 committed by John R Barker
parent 2ef4ac1404
commit b02467961a

View file

@ -87,7 +87,7 @@ options:
EXAMPLES = ''' EXAMPLES = '''
- name: "Delete GitLab Group" - name: "Delete GitLab Group"
gitlab_group: gitlab_group:
api_url: https://gitlab.example.com/ server_url: https://gitlab.example.com/
api_token: "{{ access_token }}" api_token: "{{ access_token }}"
validate_certs: False validate_certs: False
name: my_first_group name: my_first_group
@ -95,7 +95,7 @@ EXAMPLES = '''
- name: "Create GitLab Group" - name: "Create GitLab Group"
gitlab_group: gitlab_group:
api_url: https://gitlab.example.com/ server_url: https://gitlab.example.com/
validate_certs: True validate_certs: True
api_username: dj-wasabi api_username: dj-wasabi
api_password: "MySecretPassword" api_password: "MySecretPassword"
@ -106,7 +106,7 @@ EXAMPLES = '''
# The group will by created at https://gitlab.dj-wasabi.local/super_parent/parent/my_first_group # The group will by created at https://gitlab.dj-wasabi.local/super_parent/parent/my_first_group
- name: "Create GitLab SubGroup" - name: "Create GitLab SubGroup"
gitlab_group: gitlab_group:
api_url: https://gitlab.example.com/ server_url: https://gitlab.example.com/
validate_certs: True validate_certs: True
api_username: dj-wasabi api_username: dj-wasabi
api_password: "MySecretPassword" api_password: "MySecretPassword"