Skip to content

Commit

Permalink
chore: document dokku_domains set state option (dokku#160)
Browse files Browse the repository at this point in the history
Include more information on `dokku_domains` `set` option.

Co-authored-by: Leopold Talirz <[email protected]>
  • Loading branch information
luizfonseca and ltalirz authored Apr 20, 2023
1 parent b376657 commit 978b45a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,38 +442,51 @@ Manages domains for a given application
|app<br /><sup>*required*</sup>||The name of the app. This is required only if global is set to False.|
|domains<br /><sup>*required*</sup>||A list of domains|
|global|*Default:* False|Whether to change the global domains or app-specific domains.|
|state|*Choices:* <ul><li>enable</li><li>disable</li><li>clear</li><li>**present** (default)</li><li>absent</li></ul>|The state of the application's domains|
|state|*Choices:* <ul><li>enable</li><li>disable</li><li>clear</li><li>**present** (default)</li><li>absent</li><li>set</li></ul>|The state of the application's domains|

#### Example

```yaml
# Adds domain, inclusive
- name: domains:add hello-world dokku.me
dokku_domains:
app: hello-world
domains:
- dokku.me
# Removes listed domains, but leaves others unchanged
- name: domains:remove hello-world dokku.me
dokku_domains:
app: hello-world
domains:
- dokku.me
state: absent
# Clears all domains
- name: domains:clear hello-world
dokku_domains:
app: hello-world
state: clear
# Enables the VHOST domain
- name: domains:enable hello-world
dokku_domains:
app: hello-world
state: enable
# Disables the VHOST domain
- name: domains:disable hello-world
dokku_domains:
app: hello-world
state: disable
# Sets the domain for the app, clearing all others
- name: domains:set hello-world dokku.me
dokku_domains:
app: hello-world
domains:
- dokku.me
state: set
```

### dokku_git_sync
Expand Down
15 changes: 14 additions & 1 deletion library/dokku_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,53 @@
- The state of the application's domains
required: False
default: present
choices: [ "enable", "disable", "clear", "present", "absent" ]
choices: [ "enable", "disable", "clear", "present", "absent", "set" ]
aliases: []
author: Jose Diaz-Gonzalez
requirements: [ ]
"""

EXAMPLES = """
# Adds domain, inclusive
- name: domains:add hello-world dokku.me
dokku_domains:
app: hello-world
domains:
- dokku.me
# Removes listed domains, but leaves others unchanged
- name: domains:remove hello-world dokku.me
dokku_domains:
app: hello-world
domains:
- dokku.me
state: absent
# Clears all domains
- name: domains:clear hello-world
dokku_domains:
app: hello-world
state: clear
# Enables the VHOST domain
- name: domains:enable hello-world
dokku_domains:
app: hello-world
state: enable
# Disables the VHOST domain
- name: domains:disable hello-world
dokku_domains:
app: hello-world
state: disable
# Sets the domain for the app, clearing all others
- name: domains:set hello-world dokku.me
dokku_domains:
app: hello-world
domains:
- dokku.me
state: set
"""


Expand Down

0 comments on commit 978b45a

Please sign in to comment.