-
terraform-provider-libvirt
Terraform provider to provision infrastructure with Linux's KVM using libvirt
we will use the libvirt provider with Terraform to deploy a KVM Virtual Machine.
-
InfluxDB
InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
-
Ansible
Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com.
Hi, in this post, we will use Libvirt with Terraform to provision 2 KVM locally and after that, we will Deploy Flask App & PostgreSQL using Ansible.
-
--- - name: Run update ansible.builtin.apt: name: aptitude state: latest update_cache: true - name: Install dependencies ansible.builtin.apt: name: - net-tools - apt-transport-https - ca-certificates - curl - software-properties-common - python3-pip - virtualenv - python3-setuptools - gnupg-agent - autoconf - dpkg-dev - file - g++ - gcc - libc-dev - make - pkg-config - re2c - wget state: present update_cache: true - name: Add Docker GPG apt Key ansible.builtin.apt_key: url: https://download.docker.com/linux/ubuntu/gpg state: present - name: Add repository into sources list ansible.builtin.apt_repository: repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable state: present filename: docker - name: Install Docker ansible.builtin.apt: name: - docker-ce - docker-ce-cli state: present update_cache: true - name: Add non-root to docker group user: name: ubuntu groups: [docker] append: true - name: Install Docker module for Python ansible.builtin.pip: name: docker - name: Install Docker-Compose ansible.builtin.get_url: url: https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 dest: /usr/local/bin/docker-compose mode: '755' - name: Create Docker-Compose symlink ansible.builtin.command: cmd: ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose creates: /usr/bin/docker-compose - name: Restart Docker ansible.builtin.service: name: docker state: restarted enabled: true
-
Next, create main.yml in tasks. With this file we will clone flask project, add compose file, replace config.py and create new container using docker compose:
-
Nb: Project Repo: danielcristho/that-i-write
-
Sevalla
Deploy and host your apps and databases, now with $50 credit! Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!