mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
More consistent Docker unit parsing (#16748)
* Docker: Convert units for kernel_memory Other memory arguments already use human_to_bytes to convert the units. This change makes the behavior more consistent. * Update Docker unit parsing documentation This explains the units more precisely and makes the documentation more consistent. This fixes #16526.
This commit is contained in:
parent
261b90edc0
commit
2b9d4b9253
1 changed files with 21 additions and 11 deletions
|
@ -168,8 +168,10 @@ options:
|
||||||
- Override default signal used to kill a running container.
|
- Override default signal used to kill a running container.
|
||||||
kernel_memory:
|
kernel_memory:
|
||||||
description:
|
description:
|
||||||
- "Kernel memory limit (format: <number>[<unit>]). Number is a positive integer.
|
- "Kernel memory limit (format: C(<number>[<unit>])). Number is a positive integer.
|
||||||
Unit can be one of b, k, m, or g. Minimum is 4M."
|
Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte),
|
||||||
|
C(T) (tebibyte), or C(P) (pebibyte). Minimum is C(4M)."
|
||||||
|
- Omitting the unit defaults to bytes.
|
||||||
default: 0
|
default: 0
|
||||||
labels:
|
labels:
|
||||||
description:
|
description:
|
||||||
|
@ -201,18 +203,24 @@ options:
|
||||||
- Container MAC address (e.g. 92:d0:c6:0a:29:33)
|
- Container MAC address (e.g. 92:d0:c6:0a:29:33)
|
||||||
memory:
|
memory:
|
||||||
description:
|
description:
|
||||||
- "Memory limit (format: <number>[<unit>]). Number is a positive integer.
|
- "Memory limit (format: C(<number>[<unit>])). Number is a positive integer.
|
||||||
Unit can be one of b, k, m, or g"
|
Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte),
|
||||||
|
C(T) (tebibyte), or C(P) (pebibyte)."
|
||||||
|
- Omitting the unit defaults to bytes.
|
||||||
default: '0'
|
default: '0'
|
||||||
memory_reservation:
|
memory_reservation:
|
||||||
description:
|
description:
|
||||||
- "Memory soft limit (format: <number>[<unit>]). Number is a positive integer.
|
- "Memory soft limit (format: C(<number>[<unit>])). Number is a positive integer.
|
||||||
Unit can be one of b, k, m, or g"
|
Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte),
|
||||||
|
C(T) (tebibyte), or C(P) (pebibyte)."
|
||||||
|
- Omitting the unit defaults to bytes.
|
||||||
default: 0
|
default: 0
|
||||||
memory_swap:
|
memory_swap:
|
||||||
description:
|
description:
|
||||||
- Total memory limit (memory + swap, format:<number>[<unit>]).
|
- "Total memory limit (memory + swap, format: C(<number>[<unit>])).
|
||||||
Number is a positive integer. Unit can be one of b, k, m, or g.
|
Number is a positive integer. Unit can be C(B) (byte), C(K) (kibibyte, 1024B),
|
||||||
|
C(M) (mebibyte), C(G) (gibibyte), C(T) (tebibyte), or C(P) (pebibyte)."
|
||||||
|
- Omitting the unit defaults to bytes.
|
||||||
default: 0
|
default: 0
|
||||||
memory_swappiness:
|
memory_swappiness:
|
||||||
description:
|
description:
|
||||||
|
@ -325,9 +333,10 @@ options:
|
||||||
default: 0
|
default: 0
|
||||||
shm_size:
|
shm_size:
|
||||||
description:
|
description:
|
||||||
- Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater than `0`.
|
- "Size of C(/dev/shm) (format: C(<number>[<unit>])). Number is positive integer.
|
||||||
Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes).
|
Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte),
|
||||||
- Omitting the unit defaults to bytes. If you omit the size entirely, the system uses `64m`.
|
C(T) (tebibyte), or C(P) (pebibyte)."
|
||||||
|
- Omitting the unit defaults to bytes. If you omit the size entirely, the system uses C(64M).
|
||||||
security_opts:
|
security_opts:
|
||||||
description:
|
description:
|
||||||
- List of security options in the form of C("label:user:User")
|
- List of security options in the form of C("label:user:User")
|
||||||
|
@ -642,6 +651,7 @@ except:
|
||||||
|
|
||||||
|
|
||||||
REQUIRES_CONVERSION_TO_BYTES = [
|
REQUIRES_CONVERSION_TO_BYTES = [
|
||||||
|
'kernel_memory',
|
||||||
'memory',
|
'memory',
|
||||||
'memory_reservation',
|
'memory_reservation',
|
||||||
'memory_swap',
|
'memory_swap',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue