Skip to content

Commit

Permalink
sanity: doc fixes (#71)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde authored Jul 5, 2020
1 parent d53539c commit 8d44ce9
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 75 deletions.
34 changes: 18 additions & 16 deletions plugins/modules/podman_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__metaclass__ = type


DOCUMENTATION = """
DOCUMENTATION = r"""
module: podman_container
author:
- "Sagi Shnaidman (@sshnaidm)"
Expand Down Expand Up @@ -127,7 +127,7 @@
type: path
cmd_args:
description:
- Any additionl command options you want to pass to podman command,
- Any additional command options you want to pass to podman command,
cmd_args - ['--other-param', 'value']
Be aware module doesn't support idempotency if this is set.
type: list
Expand Down Expand Up @@ -464,7 +464,7 @@
type: str
pids_limit:
description:
- Tune the container's pids limit. Set -1 to have unlimited pids for the
- Tune the container's PIDs limit. Set -1 to have unlimited PIDs for the
container.
type: str
pod:
Expand Down Expand Up @@ -529,8 +529,9 @@
rootfs:
description:
- If true, the first argument refers to an exploded container on the file
system. The dafault is false.
system. The default is false.
type: bool
default: False
security_opt:
description:
- Security Options. For example security_opt "seccomp=unconfined"
Expand Down Expand Up @@ -630,22 +631,22 @@
type: str
"""

EXAMPLES = """
EXAMPLES = r"""
- name: Run container
podman_container:
containers.podman.podman_container:
name: container
image: quay.io/bitnami/wildfly
state: started
- name: Create a data container
podman_container:
containers.podman.podman_container:
name: mydata
image: busybox
volume:
- /tmp/data
- name: Re-create a redis container
podman_container:
containers.podman.podman_container:
name: myredis
image: redis
command: redis-server --appendonly yes
Expand All @@ -657,7 +658,7 @@
- mydata
- name: Restart a container
podman_container:
containers.podman.podman_container:
name: myapplication
image: redis
state: started
Expand All @@ -674,39 +675,39 @@
BOOLEAN_KEY: "yes"
- name: Container present
podman_container:
containers.podman.podman_container:
name: mycontainer
state: present
image: ubuntu:14.04
command: "sleep 1d"
- name: Stop a container
podman_container:
containers.podman.podman_container:
name: mycontainer
state: stopped
- name: Start 4 load-balanced containers
podman_container:
containers.podman.podman_container:
name: "container{{ item }}"
recreate: yes
image: someuser/anotherappimage
command: sleep 1d
with_sequence: count=4
- name: remove container
podman_container:
containers.podman.podman_container:
name: ohno
state: absent
- name: Writing output
podman_container:
containers.podman.podman_container:
name: myservice
image: busybox
log_options: path=/var/log/container/mycontainer.json
log_driver: k8s-file
"""

RETURN = """
RETURN = r"""
container:
description:
- Facts representing the current state of the container. Matches the
Expand Down Expand Up @@ -826,6 +827,7 @@
}'
"""
# noqa: F402

import json # noqa: F402
from distutils.version import LooseVersion # noqa: F402
import yaml # noqa: F402
Expand Down Expand Up @@ -2091,10 +2093,10 @@ def main():
argument_spec=yaml.safe_load(DOCUMENTATION)['options'],
mutually_exclusive=(
['no_hosts', 'etc_hosts'],

),
supports_check_mode=True,
)

# work on input vars
if module.params['state'] in ['started', 'present'] and \
not module.params['image']:
Expand Down
14 changes: 8 additions & 6 deletions plugins/modules/podman_container_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
module: podman_container_info
author:
- Sagi Shnaidman (@sshnaidm)
Expand All @@ -32,21 +32,23 @@
default: 'podman'
type: str
'''
EXAMPLES = """

EXAMPLES = r"""
- name: Gather facts for all containers
podman_container_info:
containers.podman.podman_container_info:
- name: Gather facts on a specific container
podman_container_info:
containers.podman.podman_container_info:
name: web1
- name: Gather facts on several containers
podman_container_info:
containers.podman.podman_container_info:
name:
- redis
- web1
"""
RETURN = """

RETURN = r"""
containers:
description: Facts from all or specificed containers
returned: always
Expand Down
Loading

0 comments on commit 8d44ce9

Please sign in to comment.