Z11mm / ansible-playbooks

These are playbooks to configure Jenkins on a Google Compute Engine VM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible Playbooks

Introduction

These configuration files are part of my project in this repository

Ansible Setup

To install Ansible, follow these steps:

  • Access the Ansible VM instance using ssh:

    • gcloud compute ssh <ansible-server-name>
  • Generate SSH keys:

    • ssh-keygen
  • Copy the public key:

    • sudo cat ~/.ssh/id_rsa.pub
  • Access the Jenkins VM instance using ssh.

  • Paste the public key within ~/.ssh/authorized_keys folder:

    • sudo vi /home/<username>/.ssh/authorized_keys
  • Confirm connection between the two instances:

    • ssh <jenkins-instance-ip-address>
  • Run the following commands to install Ansible:

    • Update Repository by including the official project’s PPA
      sudo apt-get update
      sudo apt-add-repository -y ppa:ansible/ansible
      sudo apt-get install software-properties-common sudo apt-get update to refresh the package manager

    • Install Ansible (and Python)
      sudo apt-get install -y ansible
      sudo apt install python-pip -y

    • Install Boto Framework
      sudo pip install boto boto3
      sudo apt-get install python-boto -y

    • Check that Ansible is installed
      ansible --version

    • Add the ip address of the target server to the Ansible's inventory file:
      sudo vi /etc/ansible/hosts

About

These are playbooks to configure Jenkins on a Google Compute Engine VM