Giter Site home page Giter Site logo

ansible-alma8's Introduction

Ansible AlmaLinux & CentOS7 demo

This repo is part of a workshop to teach people Ansible.

The Ansible control server is AlmaLinux 8, there are two nodes, a CentOS 7 node and an AlmaLinux 8 node.

Prerequisites

  • VirtualBox, tested with 7.0.14
  • Vagrant, tested with 2.4.1

Usage

Create the VMs:

vagrant up

Run Ansible to configure the nodes:

vagrant ssh acs
cd /vagrant/ansible
ansible-playbook playbook.yml -v

Using vscode to edit Ansible code

To make proper use of the vscode Ansible extension:

Install the vscode Remote-SSH extension

Click on the extensions icon (or press Ctrl-Alt-X). Search for Remote-SSH. On the Remote - SSH extension by Microsoft click 'Install'.

Set SSH configuration

Change or create the file ~/.ssh/config and add

Host acs
  HostName 127.0.0.1
  Port 21556
  User vagrant
  IdentityFile "<path to your git directory>\ansible-alma8\.vagrant\machines\acs\virtualbox\private_key"

You can check if the config is working properly by openen a prompt and typing

ssh acs

If you're logged in, everything works fine.

Connect to acs VM

In the bottom left, press the green connection button (it looks a bit like '><'). Select 'Connect to Host...', select 'acs'. When asked for an operating system type, select 'Linux'.

Vscode will now install some software on the VM.

Install extensions

Click on the extensions icon (or press Ctrl-Alt-X). Search for Ansible. On the Ansible extension by RedHat click 'Install in SSH: acs'. Another handy extension to install is Ansible Go to Definition.

Open the project folder

In the File menu select 'Open Folder...'. Type /vagrant and click OK or press Enter. Trust the directory.

You can now write Ansible code with syntax highlighting, code completion, linting and navigation.

ansible-alma8's People

Contributors

samegens avatar blauwe-lucht avatar

Watchers

 avatar

Forkers

power2all

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.