Skip to content

Instantly share code, notes, and snippets.

View NetguruGist's full-sized avatar

Netguru NetguruGist

View GitHub Profile
ansible-playbook -i inventory playbook.yml
    - name: “update ssh-key to admin user”
      authorized_key: user=admin key="SSH_KEY" exclusive=yes
  tasks:
    - name: create admin account
      user: name=admin shell=/bin/bash
- name: Basic server security
  hosts: linux
  become: true
ansible linux -i inventory -m setup
[linux]
IP_ADDRESS  ansible_ssh_user=ubuntu
{11:30}[2.2.3]~/ansible ➭ touch inventory; touch playbook.yml
{11:31}[2.2.3]~/ansible ➭ ls
inventory    playbook.yml
{11:31}[2.2.3]~/ansible ➭
{11:30}[2.2.3]~ ➭ mkdir ~/ansible; cd ~/ansible
{11:30}[2.2.3]~/ansible ➭
apt-get update && apt-get install -y python
apt-get update && apt-get install -y python