Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovirt: default save true in setup host networks #49983

Merged
merged 6 commits into from
Mar 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions lib/ansible/modules/cloud/ovirt/ovirt_host_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@
type: bool
save:
description:
- "If I(true) network configuration will be persistent, by default they are temporarily."
- "If I(true) network configuration will be persistent, otherwise it is temporary. Default I(true) since Ansible 2.8."
type: bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add default value also into documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not the documentation? Would you please specify where else to make changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment at the start of the file not the documentation? Would you please specify where else to make changes? thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be enough just to add default: True to the docs, similarly as we have for example in ovirt_vm module: https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_vm.py#L42

default: True
sync_networks:
description:
- "If I(true) all networks will be synchronized before modification"
Expand All @@ -89,6 +90,8 @@
# Examples don't contain auth parameter for simplicity,
# look at ovirt_auth module to see how to reuse authentication:

# In all examples the durability of the configuration created is dependent on the 'save' option value:

# Create bond on eth0 and eth1 interface, and put 'myvlan' network on top of it and persist the new configuration:
- name: Bonds
ovirt_host_network:
Expand All @@ -108,7 +111,7 @@
gateway: 1.2.3.4
version: v4

# Create bond on eth1 and eth2 interface, specifiyng both mode and miimon temporarily:
# Create bond on eth1 and eth2 interface, specifiyng both mode and miimon:
- name: Bonds
ovirt_host_network:
name: myhost
Expand All @@ -121,30 +124,30 @@
- eth1
- eth2

# Remove bond0 bond from host interfaces temporarily:
# Remove bond0 bond from host interfaces:
- ovirt_host_network:
state: absent
name: myhost
bond:
name: bond0

# Assign myvlan1 and myvlan2 vlans to host eth0 interface temporarily:
# Assign myvlan1 and myvlan2 vlans to host eth0 interface:
- ovirt_host_network:
name: myhost
interface: eth0
networks:
- name: myvlan1
- name: myvlan2

# Remove myvlan2 vlan from host eth0 interface temporarily:
# Remove myvlan2 vlan from host eth0 interface:
- ovirt_host_network:
state: absent
name: myhost
interface: eth0
networks:
- name: myvlan2

# Remove all networks/vlans from host eth0 interface temporarily:
# Remove all networks/vlans from host eth0 interface:
- ovirt_host_network:
state: absent
name: myhost
Expand Down Expand Up @@ -348,7 +351,7 @@ def main():
networks=dict(default=None, type='list'),
labels=dict(default=None, type='list'),
check=dict(default=None, type='bool'),
save=dict(default=None, type='bool'),
save=dict(default=True, type='bool'),
sync_networks=dict(default=False, type='bool'),
)
module = AnsibleModule(argument_spec=argument_spec)
Expand Down