Skip to content

Instantly share code, notes, and snippets.

@v1k0d3n
Created January 18, 2016 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v1k0d3n/2334dab6868b30da683e to your computer and use it in GitHub Desktop.
Save v1k0d3n/2334dab6868b30da683e to your computer and use it in GitHub Desktop.
---
- hosts: rpi-k8s
sudo: no
vars_prompt:
- name: "user_password"
prompt: "Enter password for user 'user'"
private: yes
tasks:
- name: make sure packages are installed
pacman: name={{ item }} state=present
with_items:
- sudo
- name: Add groups
group: name=nixadmins gid=10001 state=present
- name: create normal user
user: name={{ item }} state=present createhome=yes group=users groups=wheel,nixadmins
with_items:
- user
- name: change password for user 'user'
user: name=user password={{ user_password }}
- name: add nixadmins in the sudoers group
lineinfile: "dest=/etc/sudoers backup=yes state=present create=yes regexp='^%nixadmins' line='%nixadmins ALL=(ALL) NOPASSWD: ALL'"
- name: upgrade rpi-k8s kubernetes and system packages
command: kube-config upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment