Add support for installing CentOS with static IP address
This commit is contained in:
parent
a64145a3de
commit
a52bb767dd
2 changed files with 18 additions and 2 deletions
|
@ -6,6 +6,14 @@ num_cpus: 1
|
|||
|
||||
# extra args for virt-install
|
||||
ks_file: "{{ boot_url }}/centos7.ks"
|
||||
ipcmd: >-
|
||||
{% if network_interfaces[0]['proto'] is defined %}
|
||||
{% if network_interfaces[0]['proto'] == 'static' %}
|
||||
{% set int=network_interfaces[0] %}
|
||||
nameserver=8.8.8.8
|
||||
ip={{ int['ipaddr'] }}::{{ network_default_gateway }}:{{ int['netmask'] }}:::none
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
virt_install_os_args: >
|
||||
--extra-args "ks={{ ks_file }} console=ttyS0 net.ifnames=0 ksdevice=eth0"
|
||||
--extra-args "ks={{ ks_file }} console=ttyS0 net.ifnames=0 ksdevice=eth0 {{ ipcmd }}"
|
||||
--location https://nic.funet.fi/pub/mirrors/centos.org/7/os/x86_64
|
||||
|
|
|
@ -6,6 +6,14 @@ num_cpus: 1
|
|||
|
||||
# extra args for virt-install
|
||||
ks_file: "{{ boot_url }}/centos8.ks"
|
||||
ipcmd: >-
|
||||
{% if network_interfaces[0]['proto'] is defined %}
|
||||
{% if network_interfaces[0]['proto'] == 'static' %}
|
||||
{% set int=network_interfaces[0] %}
|
||||
nameserver=8.8.8.8
|
||||
ip={{ int['ipaddr'] }}::{{ network_default_gateway }}:{{ int['netmask'] }}:::none
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
virt_install_os_args: >
|
||||
--extra-args "ks={{ ks_file }} console=ttyS0 net.ifnames=0 ksdevice=eth0"
|
||||
--location https://nic.funet.fi/pub/mirrors/centos.org/8/BaseOS/x86_64/os
|
||||
--extra-args "ks={{ ks_file }} console=ttyS0 net.ifnames=0 ksdevice=eth0 {{ ipcmd }}"
|
||||
|
|
Loading…
Add table
Reference in a new issue