summaryrefslogtreecommitdiffstats
path: root/xci/infra/bifrost/playbooks
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2018-08-09 16:52:46 +0200
committerManuel Buil <mbuil@suse.com>2018-10-17 17:18:51 +0200
commitc380a85cb660d07da714ad3adf43439ad7938270 (patch)
tree248470a0975c2c2d330082bf8e8c032a2e6f12ad /xci/infra/bifrost/playbooks
parentb9b00f336f20bad8bc58b325172ebf9c71c83b6a (diff)
[Baremetal] Add baremetal support to create-nodes
Information about baremetal servers is collected for ironic to do the provisioning. Two main things are done: 1 - baremetalhoststojson.yml fills the json config file fed to ironic so that it knows how to boot the blades. In the baremetal case, the create_vm.yml playbook will only create opnfv vm. The variable vms_to_create holds that information. The variable baremetal_nodes specifies the physical nodes (empty when non baremetal deployments) 2 - For PXE to work, we create a file called baremetalstaticips that has the mapping between mac address from servers and its ip. That file is moved into the dnsmasq config directory Change-Id: I0e788db1deb50769c183b71524a68ac0b925f8aa Signed-off-by: Manuel Buil <mbuil@suse.com>
Diffstat (limited to 'xci/infra/bifrost/playbooks')
-rw-r--r--xci/infra/bifrost/playbooks/xci-prepare-env.yml33
-rw-r--r--xci/infra/bifrost/playbooks/xci-setup-nodes.yml3
2 files changed, 31 insertions, 5 deletions
diff --git a/xci/infra/bifrost/playbooks/xci-prepare-env.yml b/xci/infra/bifrost/playbooks/xci-prepare-env.yml
index b4ad8c0c..d576324d 100644
--- a/xci/infra/bifrost/playbooks/xci-prepare-env.yml
+++ b/xci/infra/bifrost/playbooks/xci-prepare-env.yml
@@ -18,10 +18,6 @@
vars_files:
- "{{ xci_path }}/xci/var/opnfv.yml"
tasks:
- - name: Copy bifrost inventory file
- copy:
- src: /tmp/baremetal.json
- dest: /tmp/baremetal.json
- name: Configure SSH key for devuser
user:
@@ -70,6 +66,25 @@
state: directory
become: yes
+ # Directory must exist before passing the static config
+ - name: "Setup Inventory DHCP Hosts Directory"
+ file:
+ path: "/etc/dnsmasq.d/bifrost.dhcp-hosts.d"
+ state: directory
+ owner: "root"
+ group: "root"
+ mode: 0755
+ become: yes
+
+ - name: Copy bifrost files
+ copy:
+ src: "{{ item.src }}"
+ dest: "{{ item.dst }}"
+ with_items:
+ - { src: '/tmp/baremetal.json', dst: '/tmp/baremetal.json' }
+ - { src: '/tmp/baremetalstaticips', dst: '/etc/dnsmasq.d/bifrost.dhcp-hosts.d/baremetalstaticips' }
+ become: yes
+
- name: Copy original qcow2 image to OPNFV VM
synchronize:
src: "{{ xci_cache }}/{{ item }}"
@@ -91,3 +106,13 @@
become: yes
when: _resolv_conf_netconfig.stat.exists
when: ansible_pkg_mgr == 'zypper'
+
+ #TODO: Find a way to do this with Ansible
+ - name: Make sure the default gateway is correct
+ shell: "ip route del default"
+ become: yes
+
+ #TODO: Find a way to do this with Ansible
+ - name: Make sure the default gateway is correct
+ shell: "ip route add default via {{ host_info[inventory_hostname].public.gateway }}"
+ become: yes
diff --git a/xci/infra/bifrost/playbooks/xci-setup-nodes.yml b/xci/infra/bifrost/playbooks/xci-setup-nodes.yml
index aaa50997..a0f92159 100644
--- a/xci/infra/bifrost/playbooks/xci-setup-nodes.yml
+++ b/xci/infra/bifrost/playbooks/xci-setup-nodes.yml
@@ -38,7 +38,8 @@
state: started
port: 22
connect_timeout: 10
- timeout: 180
+ timeout: 10180
+
# No ansible module for brctl found
- name: Add pxe interface to the bridge
shell: "brctl addif {{ item.bridge }} {{ item.interface }}"