Low Orbit Flux Logo 2 D

Ansible - Examples

Manual Azure VM setup:


chmod 700 Downloads/test1_key.pem           
ssh azureuser@52.226.37.195 -i Downloads/test1_key.pem
ssh -i .ssh/test1_key.pem test1

Install Ansible on Ubuntu VM on Azure:


sudo apt update
sudo apt install ansible

Run test playbook on Azure VM:


ansible-playbook --private-key ~/.ssh/test1_key.pem test1.yml

Change the prompt on fish shell:


cat ~/.config/fish/config.fish
function fish_prompt
    echo -n '$'
end

Playbook to install Apache web server on Azure VM:


test1.yml
- name: Test1 Playbook
  hosts: set1
  remote_user: azureuser
  become: yes

  tasks:
  - name: Make sure the latest version of Apache is installed
    ansible.builtin.apt:
      name: apache2
      state: latest