]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
tools: Add ansible role to generate FOG host csv file 356/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 1 Dec 2017 16:44:40 +0000 (11:44 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Fri, 1 Dec 2017 16:47:44 +0000 (11:47 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
tools/generate-fog-csv.yml [new file with mode: 0644]
tools/roles/generate-fog-csv/tasks/main.yml [new file with mode: 0644]
tools/roles/generate-fog-csv/templates/csv.j2 [new file with mode: 0644]

diff --git a/tools/generate-fog-csv.yml b/tools/generate-fog-csv.yml
new file mode 100644 (file)
index 0000000..c859448
--- /dev/null
@@ -0,0 +1,9 @@
+---
+# This playbook can be used to generate a CSV file of testnodes
+# that can be imported to the FOG web UI.
+# It outputs a CSV file to /tmp/fog_hostfile.csv
+
+- hosts: localhost
+  roles:
+    - generate-fog-csv
+  become: false
diff --git a/tools/roles/generate-fog-csv/tasks/main.yml b/tools/roles/generate-fog-csv/tasks/main.yml
new file mode 100644 (file)
index 0000000..bfbc56d
--- /dev/null
@@ -0,0 +1,5 @@
+---
+- template:
+    src: csv.j2
+    dest: /tmp/fog_hostfile.csv
+  delegate_to: localhost
diff --git a/tools/roles/generate-fog-csv/templates/csv.j2 b/tools/roles/generate-fog-csv/templates/csv.j2
new file mode 100644 (file)
index 0000000..fcde698
--- /dev/null
@@ -0,0 +1,3 @@
+{% for host in groups['cobbler_managed'] %}
+"{{ hostvars[host]['mac'] }}","{{ hostvars[host]['inventory_hostname_short'] }}","","","1","0","","","fog","","","","","","","","","{{ hostvars[host]['kernel_options'] }}","","/dev/sda","","","","","0000-00-00 00:00:00","110","","",""
+{% endfor %}