Skip to content

Commit

Permalink
Merge pull request #59 from andygrunwald/support-for-hostname
Browse files Browse the repository at this point in the history
Add support for `--hostname`
  • Loading branch information
mhutter committed Mar 10, 2023
2 parents 04dce29 + 4f2fffa commit 58ac3ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ This will create:
* `container_cap_drop` (default _{}_) - List of capabilities to drop
* `container_network` (default _""_) - [Network settings](https://docs.docker.com/engine/reference/run/#network-settings)
* `container_user` (default _""_) - [User settings](https://docs.docker.com/engine/reference/run/#user)
* `container_hostname` (default _""_) - Container host name: `--hostname` flag
* `container_devices` (default _[]_) - List of devices to add
* `container_privileged` (default _false_) - Whether the container should be privileged
* `container_start_post` - Optional command to be run by systemd after the container has started
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ container_cmd: []
container_host_network: false
container_network: ""
container_user: ""
container_hostname: ""
container_links: []
container_ports: []
container_hosts: []
Expand Down
1 change: 1 addition & 0 deletions templates/unit.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ExecStart={{ docker_path }} run \
{% if container_host_network == true %}--network host {% else %}{{ params('--publish', container_ports) }}{% endif %}\
{% if container_network %}--network {{ container_network }}{% endif %} \
{% if container_user %}--user {{ container_user }}{% endif %} \
{% if container_hostname %}--hostname {{ container_hostname }}{% endif %} \
{{ params('--link', container_links) }}\
{{ params('--add-host', container_hosts) }}\
{{ params('--label', container_labels) }}\
Expand Down

0 comments on commit 58ac3ec

Please sign in to comment.