Code Monkey home page Code Monkey logo

yandex-iac-ansible-example's Introduction

infrastructure-as-a-code-example

Examples of infrastructure as code tools include Yandex Cloud, Terraform and Ansible. Terraform code don`t use managed service in Yandex Cloud.

Install YC cli

curl https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash

Init YC cli

yc init

Get token, cloud-id, folder-id

yc config list

Output:

token: xxx
cloud-id: xxx
folder-id: xxxx
compute-default-zone: ru-central1-b

Terraform

Set up terraform

unzip terraform_1.2.4_linux_amd64.zip
sudo mv terraform /usr/local/bin/

Set terraform mirror

nano ~/.terraformrc

with code

provider_installation {
  network_mirror {
    url = "https://terraform-mirror.yandexcloud.net/"
    include = ["registry.terraform.io/*/*"]
  }
  direct {
    exclude = ["registry.terraform.io/*/*"]
  }
}

terraform fmt for private.auto.tfvars.example

find . -iname 'private.auto.tfvars.example' -execdir mv -i '{}' private.auto1.tfvars \;
terraform fmt -recursive
find . -iname 'private.auto1.tfvars' -execdir mv -i '{}' private.auto.tfvars.example \;

Ansible

Install Ansible

sudo add-apt-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible

Setting for ubuntu 22.04

sudo apt install python3-resolvelib=0.5.4-1ppa~jammy
sudo apt-mark hold python3-resolvelib

SSH

cat .ssh/config 
Host *
    StrictHostKeyChecking no
    ServerAliveInterval 5
    HashKnownHosts no

yandex-iac-ansible-example's People

Contributors

patsevanton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.