wip
This commit is contained in:
@@ -35,3 +35,4 @@
|
||||
- https://raw.githubusercontent.com/dylanaraps/pfetch/master/pfetch
|
||||
get_url: url={{item}} dest=/usr/local/bin owner=root group=root mode=0755
|
||||
become: yes
|
||||
ignore_errors: true
|
||||
|
||||
@@ -8,4 +8,5 @@
|
||||
dest: "{{ item.dest|default('/src') }}"
|
||||
key_file: "{{ item.key_file|default('~/.ssh/id_rsa') }}"
|
||||
version: "{{ item.version|default('HEAD') }}"
|
||||
ignore_errors: true
|
||||
become: yes
|
||||
|
||||
@@ -1,29 +1,15 @@
|
||||
---
|
||||
# file: tasks/ssh.yml
|
||||
|
||||
- name: ssh - add ssh_authorized_keys to file ~/.ssh/authorized_keys
|
||||
authorized_key: user="{{ ansible_user|default('root') }}" key="{{ item }}"
|
||||
with_items: "{{ hosts_ssh_authorized_keys|default([]) }}"
|
||||
ignore_errors: true
|
||||
|
||||
- name: ssh - add ssh_public_hosts keys to known_hosts
|
||||
- name: ssh - add hosts_ssh_public_hosts keys to known_hosts
|
||||
with_items: "{{ hosts_ssh_public_hosts|default([]) }}"
|
||||
known_hosts:
|
||||
path: /etc/ssh/ssh_known_hosts
|
||||
name: "{{ item }}"
|
||||
key: "{{ lookup('pipe', 'ssh-keyscan -t rsa -H ' + item) }}"
|
||||
become: true
|
||||
ignore_errors: true
|
||||
|
||||
- name: ssh - copy ssh_private_keys to ~/.ssh/
|
||||
with_items: "{{ hosts_ssh_private_keys|default([]) }}"
|
||||
copy: src="{{ item }}" dest=~/.ssh/ mode=0400
|
||||
ignore_errors: true
|
||||
|
||||
- name: ssh - update ~/.ssh/myos/config
|
||||
template:
|
||||
src: ssh_config.j2
|
||||
dest: ~/.ssh/myos/config
|
||||
mode: 0400
|
||||
|
||||
- name: ssh - define sshd configuration
|
||||
set_fact:
|
||||
sshd_config:
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
---
|
||||
# file: tasks/user.yml
|
||||
|
||||
- name: user - add hosts_ssh_authorized_keys to ~/.ssh/authorized_keys
|
||||
authorized_key: user="{{ ansible_user|default('root') }}" key="{{ item }}"
|
||||
with_items: "{{ hosts_ssh_authorized_keys|default([]) }}"
|
||||
ignore_errors: true
|
||||
|
||||
- name: user - copy hosts_ssh_private_keys to ~/.ssh/
|
||||
with_items: "{{ hosts_ssh_private_keys|default([]) }}"
|
||||
copy: src="{{ item }}" dest=~/.ssh/ mode=0400
|
||||
ignore_errors: true
|
||||
|
||||
- name: user - create ~/.env
|
||||
template:
|
||||
src: env.j2
|
||||
@@ -56,7 +66,7 @@
|
||||
|
||||
- name: user - update ~/.screenrc
|
||||
with_items:
|
||||
- defscrollback 1024
|
||||
- defscrollback 4096
|
||||
- hardstatus alwayslastline "%{= kw}[%{G}$USER@%H%{-}] \# %?%-Lw%?[%{G}%n%f %t%{-}]%?%+Lw%?%?%=%-17< [%{B}%l%{-}]"
|
||||
- shell -$SHELL
|
||||
lineinfile: dest=~/.screenrc create=yes line='{{item}}'
|
||||
@@ -66,6 +76,12 @@
|
||||
- include myos/config
|
||||
lineinfile: dest=~/.ssh/config create=yes line='{{item}}'
|
||||
|
||||
- name: ssh - update ~/.ssh/myos/config
|
||||
template:
|
||||
src: ssh_config.j2
|
||||
dest: ~/.ssh/myos/config
|
||||
mode: 0400
|
||||
|
||||
- name: user - update ~/.tmux.conf
|
||||
with_items:
|
||||
- source-file ~/.tmux/myos/config
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
file:
|
||||
/etc/issue.net:
|
||||
exists: true
|
||||
mode: "0644"
|
||||
owner: root
|
||||
group: root
|
||||
filetype: file
|
||||
/etc/profile.d/rc.sh:
|
||||
exists: true
|
||||
mode: "0644"
|
||||
@@ -11,4 +17,15 @@ file:
|
||||
owner: root
|
||||
group: root
|
||||
filetype: file
|
||||
|
||||
/usr/local/bin/goss:
|
||||
exists: true
|
||||
mode: "0755"
|
||||
owner: root
|
||||
group: root
|
||||
filetype: file
|
||||
/usr/local/bin/pfetch:
|
||||
exists: true
|
||||
mode: "0755"
|
||||
owner: root
|
||||
group: root
|
||||
filetype: file
|
||||
|
||||
@@ -7,6 +7,8 @@ package:
|
||||
installed: true
|
||||
openssh-client:
|
||||
installed: true
|
||||
py3-pip:
|
||||
installed: true
|
||||
util-linux:
|
||||
installed: true
|
||||
vim:
|
||||
|
||||
@@ -7,6 +7,8 @@ package:
|
||||
installed: true
|
||||
openssh-client:
|
||||
installed: true
|
||||
python-pip:
|
||||
installed: true
|
||||
util-linux:
|
||||
installed: true
|
||||
vim-nox:
|
||||
|
||||
@@ -7,5 +7,7 @@ package:
|
||||
installed: true
|
||||
openssh-clients:
|
||||
installed: true
|
||||
python-pip:
|
||||
installed: true
|
||||
vim-minimal:
|
||||
installed: true
|
||||
|
||||
@@ -5,6 +5,7 @@ hosts_packages_distro:
|
||||
- { "name": "coreutils", "state": "present" }
|
||||
- { "name": "groff", "state": "present" }
|
||||
- { "name": "openssh-client", "state": "present" }
|
||||
- { "name": "py3-pip", "state": "present" }
|
||||
- { "name": "util-linux", "state": "present" }
|
||||
- { "name": "vim", "state": "present" }
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ hosts_packages_distro:
|
||||
- { "name": "coreutils", "state": "present" }
|
||||
- { "name": "groff", "state": "present" }
|
||||
- { "name": "openssh-client", "state": "present" }
|
||||
- { "name": "python-pip", "state": "present" }
|
||||
- { "name": "util-linux", "state": "present" }
|
||||
- { "name": "vim-nox", "state": "present" }
|
||||
|
||||
|
||||
@@ -5,5 +5,6 @@ hosts_packages_distro:
|
||||
- { "name": "groff-base", "state": "present" }
|
||||
- { "name": "libselinux-python", "state": "present" }
|
||||
- { "name": "openssh-clients", "state": "present" }
|
||||
- { "name": "python-pip", "state": "present" }
|
||||
- { "name": "vim-minimal", "state": "present" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user