change: module directory
This commit is contained in:
parent
49dbd1243e
commit
18614e3397
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Terraform Libvirt module
|
||||
|
||||
There are some libvirt terarform modules
|
||||
@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
for i in $(ls -1 | grep -E "virt_|cloud_"); do
|
||||
|
||||
echo terraform-docs markdown "$i > $i/README.md"
|
||||
terraform-docs markdown "$i" > "$i/README.md"
|
||||
|
||||
done
|
||||
|
||||
|
||||
63
gen_docs.sh
Executable file
63
gen_docs.sh
Executable file
@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
|
||||
|
||||
list_mods ()
|
||||
{
|
||||
for f in $(find modules/ -name '*.tf' ); do echo "${f%/*}"; done | sort | uniq
|
||||
}
|
||||
|
||||
gen_mod_doc ()
|
||||
{
|
||||
local dir=$1
|
||||
local mode=$2
|
||||
local dest=${dir}/REFERENCE.md
|
||||
|
||||
terraform-docs --output-file "REFERENCE.md" ${mode//_/ } "$mod"
|
||||
# terraform-docs ${mode//_/ } "$mod" > "$dest"
|
||||
|
||||
|
||||
}
|
||||
|
||||
move_reference_in_doc_dir ()
|
||||
{
|
||||
local doc_dir='docs'
|
||||
|
||||
|
||||
for file in $(find modules -name REFERENCE.md); do
|
||||
new_name=${file#modules/}
|
||||
new_name=${new_name%/REFERENCE.md}
|
||||
new_name=${new_name//\//__}
|
||||
|
||||
|
||||
final_name=$doc_dir/$new_name.md
|
||||
final_dir=$(dirname "$final_name")
|
||||
|
||||
|
||||
if [[ ! -d "$final_dir" ]] ; then
|
||||
mkdir -p "$final_dir"
|
||||
fi
|
||||
mv "$file" "$final_name"
|
||||
done
|
||||
}
|
||||
|
||||
gen_docs ()
|
||||
{
|
||||
local modules=$(list_mods)
|
||||
local fmt="yaml"
|
||||
local fmt="pretty"
|
||||
local fmt="markdown_document"
|
||||
local fmt="markdown_table"
|
||||
|
||||
for mod in $modules; do
|
||||
mod=${mod#./}
|
||||
echo "INFO: Generate documentation for: $mod"
|
||||
gen_mod_doc "$mod" "$fmt"
|
||||
done
|
||||
move_reference_in_doc_dir
|
||||
|
||||
echo "INFO: Done"
|
||||
}
|
||||
|
||||
gen_docs
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
# Virt Volume
|
||||
|
||||
Create a single libvirt volume.
|
||||
|
||||
This module helps to create a single volume. As dmarcvicar/terraform-libvirt does not support persistant volumes, the persistant volume support is quite limited. The only case where persistants volumes are supported is in the case of new volume creation, which in turn become idempotent and will be never destroyed ever.
|
||||
|
||||
* Created:
|
||||
* Desc: Created as new disk
|
||||
* Ephemeral: True
|
||||
* Persistant: True
|
||||
* Backed:
|
||||
* Desc: Backed image from source volume
|
||||
* Ephemeral: True
|
||||
* Persistant: False
|
||||
* Sourced:
|
||||
* Desc: Downloaded image from url
|
||||
* Ephemeral: True
|
||||
* Persistant: False
|
||||
|
||||
|
||||
<!-- BEGIN_TF_DOCS -->
|
||||
<!-- END_TF_DOCS -->
|
||||
Loading…
x
Reference in New Issue
Block a user