Skip to content

Commit

Permalink
Add TFTP server
Browse files Browse the repository at this point in the history
  • Loading branch information
bigjools committed Feb 8, 2017
1 parent d72e05e commit 2cf3405
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
tags:
- ironic-config

- include: tftp.yml
when: inventory_hostname in groups['ironic_conductor']
tags:
- ironic-config

- include: ironic_db_setup.yml
when: inventory_hostname == groups['ironic_conductor'][0]
tags:
Expand All @@ -88,3 +83,8 @@
when: inventory_hostname == groups['ironic_api'][0]
tags:
- ironic-network

- include: tftp.yml
when: inventory_hostname in groups['ironic_conductor']
tags:
- ironic-config
16 changes: 14 additions & 2 deletions tasks/provisioning_network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,17 @@
subnet_name: provisioning
cidr: 10.99.0.0/16
enable_dhcp: True
allocation_pool_start: 10.0.1.100
allocation_pool_end: 10.0.1.200
allocation_pool_start: 10.99.1.100
allocation_pool_end: 10.99.1.200

# TODO: work out first IP in pool range
- name: Ascertain netns ID for provisioning network
shell: |
source /etc/metacloud/openrc.sh;
portid=$(neutron port-list|grep 10.99.1.100|awk '{print $2}');
netid=$(neutron port-show $portid|grep network_id|awk -F '|' '{print $3}'|tr -d ' ');
echo qdhcp-$netid
register: ironic_port_output

- set_fact:
ironic_provisioning_netns_id: {{ ironic_port_output.stdout }}
4 changes: 4 additions & 0 deletions tasks/tftp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@
dest: "/tftpboot/"
remote_src: True
with_items: "{{ ironic_library_modules_paths }}"

- name: Start TFTP server for provisioning network
shell: |
ip netns exec {{ ironic_provisioning_netns_id }} /usr/sbin/in.tftpd -l -vvv --map-file /tftpboot/map-file

0 comments on commit 2cf3405

Please sign in to comment.