Skip to content

Commit 4f2fffa

Browse files
committed
Add support for --hostname
1 parent 584bf0e commit 4f2fffa

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ This will create:
5454
* `container_cap_drop` (default _{}_) - List of capabilities to drop
5555
* `container_network` (default _""_) - [Network settings](https://docs.docker.com/engine/reference/run/#network-settings)
5656
* `container_user` (default _""_) - [User settings](https://docs.docker.com/engine/reference/run/#user)
57+
* `container_hostname` (default _""_) - Container host name: `--hostname` flag
5758
* `container_devices` (default _[]_) - List of devices to add
5859
* `container_privileged` (default _false_) - Whether the container should be privileged
5960
* `container_start_post` - Optional command to be run by systemd after the container has started

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ container_cmd: []
77
container_host_network: false
88
container_network: ""
99
container_user: ""
10+
container_hostname: ""
1011
container_links: []
1112
container_ports: []
1213
container_volumes: []

templates/unit.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ExecStart={{ docker_path }} run \
2929
{% if container_host_network == true %}--network host {% else %}{{ params('--publish', container_ports) }}{% endif %}\
3030
{% if container_network %}--network {{ container_network }}{% endif %} \
3131
{% if container_user %}--user {{ container_user }}{% endif %} \
32+
{% if container_hostname %}--hostname {{ container_hostname }}{% endif %} \
3233
{{ params('--link', container_links) }}\
3334
{{ params('--label', container_labels) }}\
3435
{{ params('--cap-add', container_cap_add) }}\

0 commit comments

Comments
 (0)