adding makefile
parent
b435fe12af
commit
f095a3467d
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
all: deps bootstrap homelab
|
||||||
|
|
||||||
|
SHELL := /bin/bash
|
||||||
|
bootstrap:
|
||||||
|
ansible-playbook bootstrap.yml -K -e ansible_ssh_user=cianhatton -e ansible_ssh_private_key_file=~/.ssh/id_rsa
|
||||||
|
|
||||||
|
qnap:
|
||||||
|
ansible-playbook setup-homelab.yml --limit qnap
|
||||||
|
|
||||||
|
homelab:
|
||||||
|
ansible-playbook setup-homelab.yml
|
||||||
|
|
||||||
|
deps:
|
||||||
|
pip install -r requirements.txt
|
||||||
|
ansible-galaxy install -r requirements.yml
|
||||||
@ -1,5 +1,19 @@
|
|||||||
---
|
---
|
||||||
|
# needs to be run with a different user with access to create ansible key and user.
|
||||||
|
# e.g.
|
||||||
|
# ansible-playbook bootstrap.yml -e ansible_ssh_user=cianhatton
|
||||||
|
# might additionally require -K if your user requires password for sudo.
|
||||||
|
|
||||||
|
- name: Generate SSH Key for ansible
|
||||||
|
hosts: localhost
|
||||||
|
connection: local
|
||||||
|
tasks:
|
||||||
|
- name: Generate an OpenSSH rsa keypair for ansible
|
||||||
|
community.crypto.openssh_keypair:
|
||||||
|
path: ~/.ssh/ansible
|
||||||
|
passphrase: ""
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- role: 'roles/bootstrap'
|
- role: bootstrap
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
{{item.name}} ALL=(ALL) NOPASSWD: ALL
|
||||||
Loading…
Reference in New Issue