feat: deploy centos

This commit is contained in:
Aravinth Manivannan 2023-07-03 17:27:57 +05:30
parent ed4d3a4420
commit 686ae05ce7
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
17 changed files with 1479 additions and 0 deletions

2
centos/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.terraform
terraform.tfstate terraform.tfstate.backup

View file

@ -0,0 +1,60 @@
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/dmacvicar/libvirt" {
version = "0.7.1"
constraints = "~> 0.7.0"
hashes = [
"h1:1yEJVPVFkRkbRY63+sFRAWau/eJ0xlecHWLCV8spkWU=",
"zh:1c59f2ab68da6326637ee8b03433e84af76b3e3562f251a7f2aa239a7b262a8d",
"zh:236e24ecf036e99d9d1e2081a39dc9cb4b8993850a37141a1449f20750f883d6",
"zh:4519c22b1f00c1d37d60ac6c2cb7ad5ab9dbcd44a80b4f61e68aacb54eae017d",
"zh:54de4e3c979c32af1dc71ec2846912f669a28bdb0990e8a3c1fb8fea4ede7b61",
"zh:6270a757bcf4e1f9efe47726cf0caefba30a25e59d151103cf03d1656325783c",
"zh:68b8586d5b29c0a1cb7c608a309b38db911449c072d60eee9e40e01881f1c23a",
"zh:724ba2290fea704714378e9363541420c36091e790c7f39150cde8987d4e0754",
"zh:7b6860c92376cdad98273aab4bea62546622e08f50733e4b2e58a7a859d3b49d",
"zh:986a0a4f8d9511c64bcac8010337deb43110b4c2f91969b2491fd9edc290b60e",
"zh:aff0f6f24d69cd97a44cd6059edaf355769fbb8a7643a6db4d52c9a94f98e194",
"zh:c46ca3f8384d06c13a7ed3d4b83c65b4f8dccbf9d5f624843b68d176add5c5c2",
"zh:ef310534e7d38153aca4ce31655b52a6e6c4d76f32e49732c96b62e9de1ee843",
"zh:f1566b094f4267ef2674889d874962dd41e0cba55251645e16d003c77ca8a19c",
"zh:f2e019df7b537069828c5537c481e5b7f41d2404eef6fe5c86702c20900b303d",
]
}
provider "registry.terraform.io/hashicorp/local" {
version = "2.4.0"
hashes = [
"h1:R97FTYETo88sT2VHfMgkPU3lzCsZLunPftjSI5vfKe8=",
"zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9",
"zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf",
"zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732",
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
"zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35",
"zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04",
"zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406",
"zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6",
"zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7",
"zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2",
"zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc",
"zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce",
]
}
provider "registry.terraform.io/hashicorp/template" {
version = "2.2.0"
hashes = [
"h1:94qn780bi1qjrbC3uQtjJh3Wkfwd5+tTtJHOb7KTg9w=",
"zh:01702196f0a0492ec07917db7aaa595843d8f171dc195f4c988d2ffca2a06386",
"zh:09aae3da826ba3d7df69efeb25d146a1de0d03e951d35019a0f80e4f58c89b53",
"zh:09ba83c0625b6fe0a954da6fbd0c355ac0b7f07f86c91a2a97849140fea49603",
"zh:0e3a6c8e16f17f19010accd0844187d524580d9fdb0731f675ffcf4afba03d16",
"zh:45f2c594b6f2f34ea663704cc72048b212fe7d16fb4cfd959365fa997228a776",
"zh:77ea3e5a0446784d77114b5e851c970a3dde1e08fa6de38210b8385d7605d451",
"zh:8a154388f3708e3df5a69122a23bdfaf760a523788a5081976b3d5616f7d30ae",
"zh:992843002f2db5a11e626b3fc23dc0c87ad3729b3b3cff08e32ffb3df97edbde",
"zh:ad906f4cebd3ec5e43d5cd6dc8f4c5c9cc3b33d2243c89c5fc18f97f7277b51d",
"zh:c979425ddb256511137ecd093e23283234da0154b7fa8b21c2687182d9aea8b2",
]
}

37
centos/Makefile Normal file
View file

@ -0,0 +1,37 @@
default:
echo yes | terraform destroy
terraform plan --out=plan
terraform apply plan
inventory:
terraform plan --out=plan
terraform apply plan
configure:
ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/playbook.yml
check:
ansible-playbook --check ./ansible/playbook.yml
lint:
terraform fmt
ansible-lint --write ./ansible/playbook.yml
ansible-lint --write ./ansible/shutdown.yml
. ./venv/bin/activate && black tests/
on:
./scripts/on.sh
virsh list
shutdown:
ansible-playbook -i ./ansible/inventory/hosts.ini -f 10 ./ansible/shutdown.yml
# ./ansible/playbook.yml
test:
. ./venv/bin/activate && \
cd tests/ && \
py.test --hosts='ansible://all' \
-n 10 \
--verbose \
--ansible-inventory='../ansible/inventory/hosts.ini'

158
centos/ansible/.gitignore vendored Normal file
View file

@ -0,0 +1,158 @@
inventory/
.env
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
keys
htmlcov/
tmp/
static/

19
centos/ansible/init.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash
ansible live \
-m ansible.builtin.ping \
-i ./ansible/inventory
ansible live \
-m ansible.builtin.apt \
-f 10 \
-a "update_cache=yes upgrade=safe" \
-i ./ansible/inventory/
ansible live \
-m ansible.builtin.apt \
-f 10 \
-a "name=nginx,git,curl,wget,vim,zip,nginx" \
-i ./ansible/inventory/

117
centos/ansible/playbook.yml Normal file
View file

@ -0,0 +1,117 @@
---
- name: Configure webservers
hosts: debainbasic
remote_user: root
tasks:
- name: Ensure all VMs are reachable
ansible.builtin.ping:
- name: Update package cache
ansible.builtin.apt:
update_cache: true
upgrade: safe
- name: Install git, zip, nginx, wget, curl & other utils
ansible.builtin.apt:
update_cache: true
pkg:
- git
- nginx
- wget
- curl
- gpg
- ca-certificates
- zip
- python3-pip
- virtualenv
- ufw
- fail2ban
- nginx
- dnsutils
- bind9
- python3-setuptools
- name: Create /etc/apt/keyrings dir
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
recurse: true
- name: Add Docker GPG apt Key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker Repository
ansible.builtin.apt_repository:
repo: deb https://download.docker.com/linux/debian buster stable
state: present
- name: Update apt and install docker-ce
ansible.builtin.apt:
name: docker-ce
update_cache: true
- name: Install Docker Module for Python
ansible.builtin.pip:
name: docker
- name: Set logging
community.general.ufw:
logging: "on"
- name: Allow port 22 and enable UFW
community.general.ufw:
state: enabled
rule: allow
proto: tcp
port: "22"
- name: Allow port 80
community.general.ufw:
state: enabled
proto: tcp
rule: allow
port: "80"
- name: Allow port 443
community.general.ufw:
state: enabled
proto: tcp
rule: allow
port: "443"
- name: Allow port 53
community.general.ufw:
state: enabled
proto: udp
rule: allow
port: "43"
- name: Enable and start ufw service
ansible.builtin.service:
name: ufw
enabled: true
state: started
- name: Enable and start nginx service
ansible.builtin.service:
name: nginx
enabled: true
state: started
- name: Enable and start bind9
ansible.builtin.service:
name: bind9
enabled: true
state:
started
# - debug: var=ansible_all_ipv4_addresses
# - debug: var=ansible_default_ipv4.address
handlers:
- name: Restart bind9
ansible.builtin.service:
name: nginx
state: restarted

View file

@ -0,0 +1,8 @@
---
- name: Shutdown machines
hosts: debainbasic
remote_user: root
tasks:
- name: Ensure all VMs are reachable
community.general.shutdown:

BIN
centos/centos.plan Normal file

Binary file not shown.

51
centos/cloud_init.cfg Normal file
View file

@ -0,0 +1,51 @@
#cloud-config
# vim: syntax=yaml
#
# ***********************
# ---- for more examples look at: ------
# ---> https://cloudinit.readthedocs.io/en/latest/topics/examples.html
# ******************************
#
# This is the configuration syntax that the write_files module
# will know how to understand. encoding can be given b64 or gzip or (gz+b64).
# The content will be decoded accordingly and then written to the path that is
# provided.
#
# Note: Content strings here are truncated for example purposes.
#users:
# - default
## - name: root
#### plain_text_passwd: foobar12
## ssh_import_id:
## - gh:realaravinth
# - name: atm
# plain_text_passwd: foobar12
# gecos: Aravinth Manivannan
# groups: users, admin
# sudo: ALL=(ALL) NOPASSWD:ALL
# lock_password: false
# ssh_import_id:
# - gh:realaravinth
users:
- name: root
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com
- name: atm
gecos: Aravinth Manivannan
groups: users, admin
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: true
plain_text_passwd: fooabr12
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com
ssh_pwauth: true
chpasswd:
list: |
root:foobar12
atm:foobar12
expire: False

141
centos/conf.tf Normal file
View file

@ -0,0 +1,141 @@
terraform {
required_version = ">= 0.13"
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
version = "~> 0.7.0"
}
}
}
# instance the provider
provider "libvirt" {
uri = "qemu:///system"
}
resource "libvirt_pool" "centos_basic" {
name = "centos_basic"
type = "dir"
path = "/home/atm/code/libvirt/pool/centos_basic"
}
# We fetch the latest centos_basic release image from their mirrors
resource "libvirt_volume" "centos8-qcow2" {
name = "centos8-qcow2"
pool = libvirt_pool.centos_basic.name
source = "/home/atm/disk-images/CentOS-8-ec2-8.4.2105-20210603.0.x86_64.qcow2"
format = "qcow2"
}
variable "vm_count" {
default = 3
}
resource "libvirt_volume" "domain_centos_basic_volume" {
name = "domain_centos_basic_volume-${count.index}"
base_volume_id = libvirt_volume.centos8-qcow2.id
count = var.vm_count
size = 85368709120
}
data "template_file" "user_data" {
template = file("${path.module}/cloud_init.cfg")
}
data "template_file" "network_config" {
template = file("${path.module}/network_config.cfg")
}
# for more info about paramater check this out
# https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/cloudinit.html.markdown
# Use CloudInit to add our ssh-key to the instance
# you can add also meta_data field
resource "libvirt_cloudinit_disk" "commoninit" {
name = "commoninit.iso"
user_data = data.template_file.user_data.rendered
network_config = data.template_file.network_config.rendered
pool = libvirt_pool.centos_basic.name
}
# Create the machine
resource "libvirt_domain" "domain_centos_basic" {
count = var.vm_count
name = "centos_basic_${count.index}"
memory = "3000"
vcpu = 4
cloudinit = libvirt_cloudinit_disk.commoninit.id
network_interface {
network_name = "default"
wait_for_lease = true
}
# IMPORTANT: this is a known bug on cloud images, since they expect a console
# we need to pass it
# https://bugs.launchpad.net/cloud-images/+bug/1573095
console {
type = "pty"
target_port = "0"
target_type = "serial"
}
console {
type = "pty"
target_type = "virtio"
target_port = "1"
}
disk {
volume_id = element(libvirt_volume.domain_centos_basic_volume.*.id, count.index)
}
graphics {
type = "spice"
listen_type = "address"
autoport = true
}
}
locals {
vm_ips = [for i in libvirt_domain.domain_centos_basic : i.network_interface.0.addresses[0]]
vm_names = [for i in libvirt_domain.domain_centos_basic : i.name]
# vm_names = zipmap(vm_names, vm_ips)
vm_map = [for i in libvirt_domain.domain_centos_basic : {
ip = i.network_interface.0.addresses[0],
name = i.name
}]
# libvirt_domain.domain_centos_basic.*.network_interface.0.addresses[0]
}
output "centos_ip" {
#value = [local.vm_ips, local.vm_names]
value = local.vm_map
}
resource "local_file" "hosts_yml" {
# content = <<-EOT
#[debain_basic_webservers]:
# hosts:
# %{ for vm in libvirt_domain.domain_centos_basic ~}
# ${vm.name}:
# ansible_host: ${vm.network_interface.0.addresses[0]}
# ansible_user: root
# %{ endfor ~}
# EOT
content = templatefile("./templates/hosts.yml.tftpl",
{
vm_ips = local.vm_ips,
vm_names = local.vm_names,
vms = local.vm_map
})
filename = "./ansible/inventory/hosts.ini"
}

View file

@ -0,0 +1,4 @@
version: 2
ethernets:
ens3:
dhcp4: true

BIN
centos/plan Normal file

Binary file not shown.

286
centos/requirements.txt Normal file
View file

@ -0,0 +1,286 @@
airdrop-ng==1.1
airgraph-ng==1.1
alabaster==0.7.12
aniso8601==9.0.1
ansible==6.5.0
ansible-compat==2.2.1
ansible-core==2.13.5
ansible-lint==6.8.2
anytree==2.8.0
apipkg==3.0.1
apparmor==3.1.1
appdirs==1.4.4
astroid==2.12.12
attrs==20.3.0
autocommand==2.2.1
autopage==0.5.1
Babel==2.9.0
Beaker==1.11.0
beautifulsoup4==4.11.1
binwalk==2.3.3
black==22.10.0
borgbackup==1.2.2
bracex==2.3.post1
Brlapi==0.8.4
btrfsutil==6.0
CacheControl==0.12.11
cached-property==1.5.2
cachetools==5.2.0
certifi==2020.12.5
cffi==1.14.5
chardet==4.0.0
charset-normalizer==2.1.1
cheroot==8.6.0
CherryPy==18.8.0
click==8.1.3
cliff==3.5.0
clipboard==0.0.4
cmd2==1.5.0
codespell==2.2.1
colorama==0.4.5
commonmark==0.9.1
ConfigArgParse==1.5.2
contextlib2==21.6.0
coursera-dl==0.11.5
coverage==6.5.0
crit==3.17.1
cryptography==3.4.7
cupshelpers==1.0
cycler==0.11.0
Cython==0.29.32
debtcollector==2.2.0
decorator==5.0.7
defusedxml==0.7.1
Deprecated==1.2.13
deprecation==2.1.0
dill==0.3.5.1
distlib==0.3.6
distro==1.5.0
Django==2.2
django-debug-toolbar==1.4
dnspython==2.2.1
docker==4.4.1
dockerpty==0.4.1
docopt==0.6.2
docutils==0.19
dogpile.cache==1.1.2
elasticsearch==7.9.0
filelock==3.8.0
Flask==2.2.2
Flask-RESTful==0.3.9
fonttools==4.38.0
future==0.18.2
gevent==22.10.1
git-filter-repo==2.34.0
google-api-core==2.10.0
google-api-python-client==2.60.0
google-auth==2.6.0
google-auth-httplib2==0.1.0
googleapis-common-protos==1.56.4
gpg==1.18.0
greenlet==1.1.3
grpcio==1.50.0
html5lib==1.1
httpie==3.2.1
httplib2==0.20.4
idna==2.10
imagesize==1.4.1
importlib-metadata==5.0.0
inflect==6.0.2
iniconfig==1.1.1
iso8601==0.1.14
isodate==0.6.1
isort==5.10.1
itsdangerous==2.1.2
jaraco.classes==3.2.3
jaraco.collections==3.5.1
jaraco.context==4.1.2
jaraco.functools==3.5.2
jaraco.text==3.10.0
jedi==0.18.1
Jinja2==3.1.2
jmespath==0.10.0
joblib==1.2.0
jsonpatch==1.32
jsonpointer==2.1
jsonschema==4.16.0
keystoneauth1==4.3.1
kiwisolver==1.4.4
lazy-object-proxy==1.7.1
lensfun==0.3.3
LibAppArmor==3.1.1
libfdt==1.6.1
libvirt-python==8.8.0
lit==14.0.6.dev0
logutils==0.3.5
louis==3.23.0
lxml==4.9.1
Mako==1.2.3
mallard-ducktype==1.0.2
Markdown==3.4.1
MarkupSafe==2.1.1
matplotlib==3.5.2
mccabe==0.7.0
MemoizeDB==2021.11.20.2.41.2
mercurial==6.2.3
meson==0.63.3
mock==3.0.5
more-itertools==9.0.0
msgpack==1.0.2
multidict==6.0.2
munch==2.5.0
mypy-extensions==0.4.3
netaddr==0.7.19
netifaces==0.10.9
nftables==0.1
nose==1.3.7
nspektr==0.4.0
numpy==1.23.4
oauthlib==3.1.0
openshot-qt==2.6.1
openstacksdk==0.52.0
ordered-set==4.1.0
os-client-config==2.1.0
os-service-types==1.7.0
osc-lib==2.3.1
oslo.config==8.5.0
oslo.i18n==5.0.1
oslo.serialization==4.1.0
oslo.utils==4.8.0
packaging==20.9
paramiko==2.7.2
parso==0.8.3
pathspec==0.10.1
pbr==5.5.1
pecan==1.4.2
pep517==0.13.0
Pillow==9.2.0
pipenv==2022.10.4
pkgconfig==1.5.5
platformdirs==2.5.2
pluggy==1.0.0
ply==3.11
pm2ml==2021.11.20.2.41.2
portend==3.1.0
Powerpill==2021.11.20.2.41.2
prettytable==0.7.2
progress==1.6
prometheus-client==0.15.0
protobuf==4.21.7
psutil==5.9.2
pwquality==1.4.4
py==1.11.0
pyalpm==0.10.6
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycairo==1.21.0
pycodestyle==2.9.1
pycparser==2.20
pycups==2.0.1
pycurl==7.45.1
pydantic==1.10.2
Pygments==2.13.0
PyGObject==3.42.2
PyJWT==2.5.0
pylint==2.14.5
pynvim==0.4.3
pyOpenSSL==20.0.1
pyparsing==2.4.7
pyperclip==1.8.2
PyQt5==5.15.7
PyQt5-sip==12.11.0
pyrsistent==0.17.3
PySocks==1.7.1
pytest==7.1.3
pytest-cov==4.0.0
pytest-testinfra==6.8.0
python-cinderclient==7.4.0
python-dateutil==2.8.2
python-dotenv==0.17.0
python-glanceclient==3.3.0
python-heatclient==2.3.0
python-keystoneclient==4.2.0
python-novaclient==17.4.0
python-openstackclient==5.4.0
python-swiftclient==3.11.1
python3-openid==3.2.0
pytz==2021.1
pyvenv==0.2.2
pyxdg==0.28
PyYAML==5.4.1
pyzmq==24.0.1
redis==4.3.4
Reflector==2021.11.20.2.41.3
repoze.lru==0.7
requests==2.25.1
requests-oauthlib==1.3.0
requests-toolbelt==0.10.0
requestsexceptions==1.4.0
resolvelib==0.8.1
retrying==1.3.3
rfc3986==1.4.0
rich==12.6.0
Routes==2.5.1
rpm==4.18.0
rsa==4.9
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.7
scikit-learn==1.1.2
scipy==1.9.3
sh==1.12.14
shade==1.30.0
simplejson==3.17.2
six==1.15.0
snowballstemmer==2.2.0
soupsieve==2.2.1
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sqlparse==0.4.1
stevedore==3.3.0
subprocess-tee==0.3.5
TBB==0.2
tblib==1.7.0
team==1.0
tempora==5.0.2
tenacity==8.1.0
termcolor==1.1.0
texttable==1.6.3
threadpoolctl==3.1.0
toml==0.10.2
tomli==2.0.1
tomlkit==0.11.5
torbrowser-launcher==0.3.5
trash-cli==0.22.8.27
trove-classifiers==2022.10.19
typing_extensions==4.4.0
ufw==0.36.1
uritemplate==4.1.1
urllib3==1.26.4
validate-pyproject==0.10.1
vboxapi==1.0
virtualenv==20.16.4
virtualenv-clone==0.5.7
waitress==2.1.2
warlock==1.3.3
wcmatch==8.4.1
wcwidth==0.2.5
webencodings==0.5.1
WebOb==1.8.7
websocket-client==0.58.0
WebTest==3.0.0
Werkzeug==2.2.2
wrapt==1.12.1
XCGF==2021.11.20.2.41.3
XCPF==2021.12.24.10.22.41
xmlsec==1.3.13
yamllint==1.28.0
youtube-dl==2021.12.17
zc.lockfile==2.0
zipp==3.4.1
zope.event==4.5.0
zope.interface==5.5.0

7
centos/scripts/on.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
for vm in $(virsh list --all --name --state-shutoff); do \
echo "[*] Starting vm: $vm"; \
virsh start $vm; \
done

View file

@ -0,0 +1,4 @@
[debainbasic]
%{ for vm in vms ~}
${vm.name} ansible_host=${vm.ip} ansible_user=root
%{ endfor ~}

9
centos/terraform.tfstate Normal file
View file

@ -0,0 +1,9 @@
{
"version": 4,
"terraform_version": "1.5.2",
"serial": 54,
"lineage": "5b6bd2b1-13f8-d5a9-2078-2afd131c2172",
"outputs": {},
"resources": [],
"check_results": null
}

View file

@ -0,0 +1,576 @@
{
"version": 4,
"terraform_version": "1.5.2",
"serial": 41,
"lineage": "5b6bd2b1-13f8-d5a9-2078-2afd131c2172",
"outputs": {
"centos_ip": {
"value": [
{
"ip": "192.168.122.239",
"name": "centos_basic_0"
},
{
"ip": "192.168.122.185",
"name": "centos_basic_1"
},
{
"ip": "192.168.122.191",
"name": "centos_basic_2"
}
],
"type": [
"tuple",
[
[
"object",
{
"ip": "string",
"name": "string"
}
],
[
"object",
{
"ip": "string",
"name": "string"
}
],
[
"object",
{
"ip": "string",
"name": "string"
}
]
]
]
}
},
"resources": [
{
"mode": "data",
"type": "template_file",
"name": "network_config",
"provider": "provider[\"registry.terraform.io/hashicorp/template\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"filename": null,
"id": "b36a1372ce4ea68b514354202c26c0365df9a17f25cd5acdeeaea525cd913edc",
"rendered": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
"template": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
"vars": null
},
"sensitive_attributes": []
}
]
},
{
"mode": "data",
"type": "template_file",
"name": "user_data",
"provider": "provider[\"registry.terraform.io/hashicorp/template\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"filename": null,
"id": "0803bce6fdae67bc50101596e1ce03ca05fc5c9cb1feecbb9ebd2780b84a2569",
"rendered": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\n#users:\n# - default\n## - name: root\n####\tplain_text_passwd: foobar12\n##\tssh_import_id:\n##\t\t- gh:realaravinth\n# - name: atm\n#\tplain_text_passwd: foobar12\n#\tgecos: Aravinth Manivannan\n#\tgroups: users, admin\n#\tsudo: ALL=(ALL) NOPASSWD:ALL\n#\tlock_password: false\n#\tssh_import_id:\n#\t\t- gh:realaravinth\n\n\n\nusers:\n- name: root\n ssh_authorized_keys:\n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n- name: atm\n gecos: Aravinth Manivannan\n groups: users, admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n lock_passwd: true\n plain_text_passwd: fooabr12\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n\nssh_pwauth: true\nchpasswd:\n list: |\n root:foobar12\n atm:foobar12\n expire: False\n",
"template": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\n#users:\n# - default\n## - name: root\n####\tplain_text_passwd: foobar12\n##\tssh_import_id:\n##\t\t- gh:realaravinth\n# - name: atm\n#\tplain_text_passwd: foobar12\n#\tgecos: Aravinth Manivannan\n#\tgroups: users, admin\n#\tsudo: ALL=(ALL) NOPASSWD:ALL\n#\tlock_password: false\n#\tssh_import_id:\n#\t\t- gh:realaravinth\n\n\n\nusers:\n- name: root\n ssh_authorized_keys:\n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n- name: atm\n gecos: Aravinth Manivannan\n groups: users, admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n lock_passwd: true\n plain_text_passwd: fooabr12\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n\nssh_pwauth: true\nchpasswd:\n list: |\n root:foobar12\n atm:foobar12\n expire: False\n",
"vars": null
},
"sensitive_attributes": []
}
]
},
{
"mode": "managed",
"type": "libvirt_cloudinit_disk",
"name": "commoninit",
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "/home/atm/code/libvirt/pool/centos_basic/commoninit.iso;81bd2817-7770-4c3e-ae4e-f6d1b9e0ff98",
"meta_data": "",
"name": "commoninit.iso",
"network_config": "version: 2\nethernets:\n ens3:\n dhcp4: true\n",
"pool": "centos_basic",
"user_data": "#cloud-config\n# vim: syntax=yaml\n#\n# ***********************\n# \t---- for more examples look at: ------\n# ---\u003e https://cloudinit.readthedocs.io/en/latest/topics/examples.html\n# ******************************\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided.\n#\n# Note: Content strings here are truncated for example purposes.\n#users:\n# - default\n## - name: root\n####\tplain_text_passwd: foobar12\n##\tssh_import_id:\n##\t\t- gh:realaravinth\n# - name: atm\n#\tplain_text_passwd: foobar12\n#\tgecos: Aravinth Manivannan\n#\tgroups: users, admin\n#\tsudo: ALL=(ALL) NOPASSWD:ALL\n#\tlock_password: false\n#\tssh_import_id:\n#\t\t- gh:realaravinth\n\n\n\nusers:\n- name: root\n ssh_authorized_keys:\n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n- name: atm\n gecos: Aravinth Manivannan\n groups: users, admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash\n lock_passwd: true\n plain_text_passwd: fooabr12\n ssh_authorized_keys: \n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/wXdHpwpY/4ubhYTmuNdGepQpj1kchvTUTApxMZyfyVW4uzrPRTYsle1y9QbTBV35qLkNajRC/wmC5/xPchdXpsJpuD9st1HMhLeR8qwaPyptiYJYT+z/WisWw2k6oWhG3QKvPoRtBdW9nhZnkG+O6zkuGXiRHpS7j2VVboDPpWEe1UdELQFVCwfraRal2g3ENFZ/9V1UrW/4ahRnQnSxERplZUm/fgSxQtmXubTkW68ut7yasBsrKFffMm8JztW0tWgTlTKONd3LCjv4juM0t5+cJDotNDnUR86Tq2PG8io7no/h8BWtazmjdpfGgn02ibX26BkdU0LDEYbJt5q9/Fh9TGk2ZwcMQeyepO1AWQgkmHXZWZELqu6MLQpqdtsOjHp9k0MeSpuIbdwzgf10Ydy7vK1z8irS24tVNNnJaMBwOlVOPwfyztHRADPkFcv2lKSjS1uyKR0FIkV8Kvs4txaIjmwv2LfMg6lF5W6j3ZPLyeE4cplJP0DDjzorSanu31xVnqVb3A8V9awsJ/4H7d59bI99c7QHL4K3fBVP3O0gqd31xAVRsdGs5Tj2P+RpiI6o5JJiOa1+DuBdWzrVIXYchQ30ZjaJp1wTNsYLmAsjeYuQZE2tf1xvywdzD4MB4avugDEWikzRWN9V5PHDZr1bamTCCjOrb2PRCd7eSQ== aravinth7820@gmail.com\n\nssh_pwauth: true\nchpasswd:\n list: |\n root:foobar12\n atm:foobar12\n expire: False\n"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"data.template_file.network_config",
"data.template_file.user_data",
"libvirt_pool.centos_basic"
]
}
]
},
{
"mode": "managed",
"type": "libvirt_domain",
"name": "domain_centos_basic",
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
"instances": [
{
"index_key": 0,
"schema_version": 0,
"attributes": {
"arch": "x86_64",
"autostart": false,
"boot_device": [],
"cloudinit": "/home/atm/code/libvirt/pool/centos_basic/commoninit.iso;81bd2817-7770-4c3e-ae4e-f6d1b9e0ff98",
"cmdline": [],
"console": [
{
"source_host": "127.0.0.1",
"source_path": "",
"source_service": "0",
"target_port": "0",
"target_type": "serial",
"type": "pty"
},
{
"source_host": "127.0.0.1",
"source_path": "",
"source_service": "0",
"target_port": "1",
"target_type": "virtio",
"type": "pty"
}
],
"coreos_ignition": null,
"cpu": [
{
"mode": "custom"
}
],
"description": "",
"disk": [
{
"block_device": "",
"file": "",
"scsi": false,
"url": "",
"volume_id": "/var/lib/libvirt/images/domain_centos_basic_volume-0",
"wwn": ""
}
],
"emulator": "/usr/bin/qemu-system-x86_64",
"filesystem": [],
"firmware": null,
"fw_cfg_name": "opt/com.coreos/config",
"graphics": [
{
"autoport": true,
"listen_address": "127.0.0.1",
"listen_type": "address",
"type": "spice",
"websocket": 0
}
],
"id": "2cc84e95-ebe9-4fd2-85dc-3988fb868abe",
"initrd": "",
"kernel": "",
"machine": "pc",
"memory": 3000,
"metadata": null,
"name": "centos_basic_0",
"network_interface": [
{
"addresses": [
"192.168.122.239"
],
"bridge": "",
"hostname": "centos_basic_0",
"mac": "52:54:00:72:72:06",
"macvtap": "",
"network_id": "f50e127a-7413-4d45-80de-587b22da0aa6",
"network_name": "default",
"passthrough": "",
"vepa": "",
"wait_for_lease": true
}
],
"nvram": [],
"qemu_agent": false,
"running": true,
"timeouts": null,
"tpm": [],
"vcpu": 4,
"video": [],
"xml": []
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDB9fQ==",
"dependencies": [
"data.template_file.network_config",
"data.template_file.user_data",
"libvirt_cloudinit_disk.commoninit",
"libvirt_pool.centos_basic",
"libvirt_volume.centos8-qcow2",
"libvirt_volume.domain_centos_basic_volume"
]
},
{
"index_key": 1,
"schema_version": 0,
"attributes": {
"arch": "x86_64",
"autostart": false,
"boot_device": [],
"cloudinit": "/home/atm/code/libvirt/pool/centos_basic/commoninit.iso;81bd2817-7770-4c3e-ae4e-f6d1b9e0ff98",
"cmdline": null,
"console": [
{
"source_host": "127.0.0.1",
"source_path": "",
"source_service": "0",
"target_port": "0",
"target_type": "serial",
"type": "pty"
},
{
"source_host": "127.0.0.1",
"source_path": "",
"source_service": "0",
"target_port": "1",
"target_type": "virtio",
"type": "pty"
}
],
"coreos_ignition": null,
"cpu": [
{
"mode": "custom"
}
],
"description": "",
"disk": [
{
"block_device": "",
"file": "",
"scsi": false,
"url": "",
"volume_id": "/var/lib/libvirt/images/domain_centos_basic_volume-1",
"wwn": ""
}
],
"emulator": "/usr/bin/qemu-system-x86_64",
"filesystem": [],
"firmware": null,
"fw_cfg_name": "opt/com.coreos/config",
"graphics": [
{
"autoport": true,
"listen_address": "127.0.0.1",
"listen_type": "address",
"type": "spice",
"websocket": 0
}
],
"id": "82916b5b-9e45-440c-8cae-ecb8e68d987d",
"initrd": "",
"kernel": "",
"machine": "pc",
"memory": 3000,
"metadata": null,
"name": "centos_basic_1",
"network_interface": [
{
"addresses": [
"192.168.122.185"
],
"bridge": "",
"hostname": "",
"mac": "52:54:00:E6:DD:A3",
"macvtap": "",
"network_id": "f50e127a-7413-4d45-80de-587b22da0aa6",
"network_name": "default",
"passthrough": "",
"vepa": "",
"wait_for_lease": true
}
],
"nvram": [],
"qemu_agent": false,
"running": true,
"timeouts": null,
"tpm": [],
"vcpu": 4,
"video": [],
"xml": []
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDB9fQ==",
"dependencies": [
"libvirt_cloudinit_disk.commoninit",
"libvirt_volume.centos8-qcow2",
"libvirt_volume.domain_centos_basic_volume"
]
},
{
"index_key": 2,
"schema_version": 0,
"attributes": {
"arch": "x86_64",
"autostart": false,
"boot_device": [],
"cloudinit": "/home/atm/code/libvirt/pool/centos_basic/commoninit.iso;81bd2817-7770-4c3e-ae4e-f6d1b9e0ff98",
"cmdline": null,
"console": [
{
"source_host": "127.0.0.1",
"source_path": "",
"source_service": "0",
"target_port": "0",
"target_type": "serial",
"type": "pty"
},
{
"source_host": "127.0.0.1",
"source_path": "",
"source_service": "0",
"target_port": "1",
"target_type": "virtio",
"type": "pty"
}
],
"coreos_ignition": null,
"cpu": [
{
"mode": "custom"
}
],
"description": "",
"disk": [
{
"block_device": "",
"file": "",
"scsi": false,
"url": "",
"volume_id": "/var/lib/libvirt/images/domain_centos_basic_volume-2",
"wwn": ""
}
],
"emulator": "/usr/bin/qemu-system-x86_64",
"filesystem": [],
"firmware": null,
"fw_cfg_name": "opt/com.coreos/config",
"graphics": [
{
"autoport": true,
"listen_address": "127.0.0.1",
"listen_type": "address",
"type": "spice",
"websocket": 0
}
],
"id": "c65a2eff-db15-48aa-bb09-ba77b179497e",
"initrd": "",
"kernel": "",
"machine": "pc",
"memory": 3000,
"metadata": null,
"name": "centos_basic_2",
"network_interface": [
{
"addresses": [
"192.168.122.191"
],
"bridge": "",
"hostname": "",
"mac": "52:54:00:D6:3F:59",
"macvtap": "",
"network_id": "f50e127a-7413-4d45-80de-587b22da0aa6",
"network_name": "default",
"passthrough": "",
"vepa": "",
"wait_for_lease": true
}
],
"nvram": [],
"qemu_agent": false,
"running": true,
"timeouts": null,
"tpm": [],
"vcpu": 4,
"video": [],
"xml": []
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDB9fQ==",
"dependencies": [
"libvirt_cloudinit_disk.commoninit",
"libvirt_volume.centos8-qcow2",
"libvirt_volume.domain_centos_basic_volume"
]
}
]
},
{
"mode": "managed",
"type": "libvirt_pool",
"name": "centos_basic",
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"allocation": 889159327744,
"available": 94191812608,
"capacity": 983351140352,
"id": "d234b230-28f3-4b61-82b7-9a9da3a1ca5b",
"name": "centos_basic",
"path": "/home/atm/code/libvirt/pool/centos_basic",
"type": "dir",
"xml": []
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "libvirt_volume",
"name": "centos8-qcow2",
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"base_volume_id": null,
"base_volume_name": null,
"base_volume_pool": null,
"format": "qcow2",
"id": "/home/atm/code/libvirt/pool/centos_basic/centos8-qcow2",
"name": "centos8-qcow2",
"pool": "centos_basic",
"size": 10737418240,
"source": "/home/atm/disk-images/CentOS-8-ec2-8.4.2105-20210603.0.x86_64.qcow2",
"xml": []
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"libvirt_pool.centos_basic"
]
}
]
},
{
"mode": "managed",
"type": "libvirt_volume",
"name": "domain_centos_basic_volume",
"provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]",
"instances": [
{
"index_key": 0,
"schema_version": 0,
"attributes": {
"base_volume_id": "/home/atm/code/libvirt/pool/centos_basic/centos8-qcow2",
"base_volume_name": null,
"base_volume_pool": null,
"format": "qcow2",
"id": "/var/lib/libvirt/images/domain_centos_basic_volume-0",
"name": "domain_centos_basic_volume-0",
"pool": "default",
"size": 85368709120,
"source": null,
"xml": []
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"libvirt_pool.centos_basic",
"libvirt_volume.centos8-qcow2"
]
},
{
"index_key": 1,
"schema_version": 0,
"attributes": {
"base_volume_id": "/home/atm/code/libvirt/pool/centos_basic/centos8-qcow2",
"base_volume_name": null,
"base_volume_pool": null,
"format": "qcow2",
"id": "/var/lib/libvirt/images/domain_centos_basic_volume-1",
"name": "domain_centos_basic_volume-1",
"pool": "default",
"size": 85368709120,
"source": null,
"xml": []
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"libvirt_volume.centos8-qcow2"
]
},
{
"index_key": 2,
"schema_version": 0,
"attributes": {
"base_volume_id": "/home/atm/code/libvirt/pool/centos_basic/centos8-qcow2",
"base_volume_name": null,
"base_volume_pool": null,
"format": "qcow2",
"id": "/var/lib/libvirt/images/domain_centos_basic_volume-2",
"name": "domain_centos_basic_volume-2",
"pool": "default",
"size": 85368709120,
"source": null,
"xml": []
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"libvirt_volume.centos8-qcow2"
]
}
]
},
{
"mode": "managed",
"type": "local_file",
"name": "hosts_yml",
"provider": "provider[\"registry.terraform.io/hashicorp/local\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"content": "[debainbasic]\ncentos_basic_0 ansible_host=192.168.122.239 ansible_user=root\ncentos_basic_1 ansible_host=192.168.122.185 ansible_user=root\ncentos_basic_2 ansible_host=192.168.122.191 ansible_user=root\n",
"content_base64": null,
"content_base64sha256": "3F+oxj0mR7KaESROkAICxWKkWmmtl2/L3PlXCyS5Cz4=",
"content_base64sha512": "UAtmCeBnmfeQ/t7fnfvzPyit90WdueObazO13njc9B7WaNI2yhweZNHKnM5ZEU55kxDNZ6uWPIwyTisrMoHoxg==",
"content_md5": "1c018bf6601b0881f69b3d30c770b4b2",
"content_sha1": "4eddd6cdd2f1234f1d7e9dddaa73703d9906d442",
"content_sha256": "dc5fa8c63d2647b29a11244e900202c562a45a69ad976fcbdcf9570b24b90b3e",
"content_sha512": "500b6609e06799f790fededf9dfbf33f28adf7459db9e39b6b33b5de78dcf41ed668d236ca1c1e64d1ca9cce59114e799310cd67ab963c8c324e2b2b3281e8c6",
"directory_permission": "0777",
"file_permission": "0777",
"filename": "./ansible/inventory/hosts.ini",
"id": "4eddd6cdd2f1234f1d7e9dddaa73703d9906d442",
"sensitive_content": null,
"source": null
},
"sensitive_attributes": [],
"dependencies": [
"libvirt_cloudinit_disk.commoninit",
"libvirt_domain.domain_centos_basic",
"libvirt_volume.centos8-qcow2",
"libvirt_volume.domain_centos_basic_volume"
]
}
]
}
],
"check_results": null
}