46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
|
---
|
||
|
# tasks file for jtom38.linux_common
|
||
|
- name: install packages
|
||
|
#ansible.builtin.apt:
|
||
|
apt:
|
||
|
name: "{{ aptPackages }}"
|
||
|
state: present
|
||
|
when: ansible_distribution == "Ubuntu"
|
||
|
|
||
|
- name: install pip packages
|
||
|
#ansible.builtin.pip:
|
||
|
pip:
|
||
|
name: "{{ pipPackages}}"
|
||
|
|
||
|
- block:
|
||
|
- name: Ensure default accounts a present
|
||
|
user:
|
||
|
name: "{{ item }}"
|
||
|
groups: sudo
|
||
|
state: present
|
||
|
with_items: "{{ users }}"
|
||
|
|
||
|
- name: Ensure .ssh directory is present
|
||
|
file:
|
||
|
path: "/home/{{ item }}/.ssh"
|
||
|
state: directory
|
||
|
with_items: "{{ users }}"
|
||
|
|
||
|
- name: Add all .pub keys to ansible's authorized_key
|
||
|
ansible.posix.authorized_key:
|
||
|
user: "ansible"
|
||
|
state: present
|
||
|
#key: "{{ lookup('file', 'files/') }}"
|
||
|
key: "{{ item }}"
|
||
|
with_file:
|
||
|
- files/miharu_linux.pub
|
||
|
|
||
|
- name: Add .pub keys to miharu's authorized_key
|
||
|
ansible.posix.authorized_key:
|
||
|
user: "miharu"
|
||
|
state: present
|
||
|
key: "{{ item }}"
|
||
|
with_file:
|
||
|
- files/miharu_linux.pub
|
||
|
|