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

Add oVirt cloud-init customization template #14139

Merged
merged 1 commit into from
Mar 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions db/fixtures/customization_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,25 @@
:script: "#cloud-config\nusers:\n - name: root\n ssh-authorized-keys:\n - <%= evm[:ws_values][:ssh_public_key] %>"
:type: CustomizationTemplateCloudInit
:system: true

- :name: oVirt cloud-init
:description: This template generates the cloud-init configuration supported by oVirt
:script: |-
Copy link
Member

Choose a reason for hiding this comment

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

💯 for using the block syntax

# Configure basic host parameeters:
host_name: <%= evm[:hostname] %>
user_name: root
root_password: <%= MiqPassword.decrypt(evm[:root_password]) %>

# Run commands to configure the network using the NetworkManager command
# line tool. Note that this expects the subnet mask in the prefix format,
# for example 24 instead of 255.255.255.0.
runcmd:
- nmcli connection down eth0
- nmcli connection modify eth0
ip4 <%= evm[:ip_addr] %>/<%= evm[:subnet_mask] %>
gw4 <%= evm[:gateway] %>
ipv4.dns "<%= evm[:dns_servers] %>"
ipv4.dns-search "<%= evm[:dns_suffixes] %>"
- nmcli connection up eth0
:type: CustomizationTemplateCloudInit
:system: true