wip
This commit is contained in:
@@ -7,3 +7,14 @@ host_key_checking = False
|
||||
[ssh_connection]
|
||||
scp_if_ssh = smart
|
||||
pipelining =True
|
||||
|
||||
[colors]
|
||||
changed = purple
|
||||
debug = dark gray
|
||||
deprecate = purple
|
||||
error = bright red
|
||||
ok = green
|
||||
skip = cyan
|
||||
unreachable = red
|
||||
verbose = blue
|
||||
warn = bright purple
|
||||
|
||||
@@ -27,7 +27,7 @@ ANSIBLE_SERVER_NAME ?= $(SERVER_NAME)
|
||||
ANSIBLE_USERNAME ?= $(USER)
|
||||
ANSIBLE_VERBOSE ?= $(if $(DEBUG),-vvvv,$(if $(VERBOSE),-v))
|
||||
CMDS += ansible ansible-playbook
|
||||
DOCKER_RUN_OPTIONS += --add-host=host.docker.internal:$(DOCKER_INTERNAL_DOCKER_HOST)
|
||||
DOCKER_RUN_OPTIONS += $(if $(DOCKER_INTERNAL_DOCKER_HOST),--add-host=host.docker.internal:$(DOCKER_INTERNAL_DOCKER_HOST))
|
||||
ENV_VARS += ANSIBLE_AWS_ACCESS_KEY_ID ANSIBLE_AWS_DEFAULT_OUTPUT ANSIBLE_AWS_DEFAULT_REGION ANSIBLE_AWS_SECRET_ACCESS_KEY ANSIBLE_CONFIG ANSIBLE_DISKS_NFS_DISK ANSIBLE_DISKS_NFS_OPTIONS ANSIBLE_DISKS_NFS_PATH ANSIBLE_DOCKER_IMAGE_TAG ANSIBLE_DOCKER_REGISTRY ANSIBLE_EXTRA_VARS ANSIBLE_GIT_DIRECTORY ANSIBLE_GIT_KEY_FILE ANSIBLE_GIT_REPOSITORY ANSIBLE_GIT_VERSION ANSIBLE_INVENTORY ANSIBLE_PLAYBOOK ANSIBLE_SSH_AUTHORIZED_KEYS ANSIBLE_SSH_BASTION_HOSTNAME ANSIBLE_SSH_BASTION_USERNAME ANSIBLE_SSH_PRIVATE_IP_RANGE ANSIBLE_SSH_PRIVATE_KEYS ANSIBLE_SSH_PUBLIC_HOSTS ANSIBLE_SSH_USERNAME ANSIBLE_USERNAME ANSIBLE_VERBOSE
|
||||
|
||||
# function ansible: Call run ansible ANSIBLE_ARGS with arg 1
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
---
|
||||
# file: tasks/myos.yml
|
||||
|
||||
- name: myos - register myos
|
||||
lookup:
|
||||
file: ~/.env
|
||||
register: myos
|
||||
- name: myos - register myos.tags
|
||||
set_fact:
|
||||
myos_tags: "{{ lookup('env', 'MYOS_TAGS_JSON')|from_json or lookup('file', '~/.env') }}"
|
||||
tags: debug
|
||||
|
||||
- debug:
|
||||
msg: "{{myos_tags|to_nice_json}}"
|
||||
tags: debug
|
||||
|
||||
- name: myos - check AWS meta-data URI
|
||||
uri:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# file rc_functions.sh: Define shell functions
|
||||
## author: Yann "aya" Autissier
|
||||
## license: MIT
|
||||
## version: 20210620
|
||||
## version: 20210711
|
||||
|
||||
# function force: Run a command sine die
|
||||
force() {
|
||||
@@ -213,7 +213,7 @@ ssh_add() {
|
||||
else
|
||||
GREP_RECURSIVE_CHAR="*"
|
||||
fi
|
||||
SSH_PRIVATE_KEYS="${SSH_PRIVATE_KEYS:-} ${dir}/id_rsa $(grep -l${GREP_RECURSIVE_FLAG:-} 'PRIVATE KEY' "${dir}"/"${GREP_RECURSIVE_CHAR:-}" 2>/dev/null |grep -vw "${dir}"/id_rsa)"
|
||||
SSH_PRIVATE_KEYS="${SSH_PRIVATE_KEYS:-} ${dir}/id_rsa $(grep -l${GREP_RECURSIVE_FLAG:-} 'PRIVATE KEY' "${dir}/"${GREP_RECURSIVE_CHAR:-} 2>/dev/null |grep -vw "${dir}"/id_rsa)"
|
||||
done
|
||||
# shellcheck disable=SC2086
|
||||
printf '%s\n' ${SSH_PRIVATE_KEYS} |while read -r file; do
|
||||
@@ -239,7 +239,7 @@ ssh_del() {
|
||||
else
|
||||
GREP_RECURSIVE_CHAR="*"
|
||||
fi
|
||||
SSH_PRIVATE_KEYS="${SSH_PRIVATE_KEYS:-} ${dir}/id_rsa $(grep -l${GREP_RECURSIVE_FLAG:-} 'PRIVATE KEY' "${dir}"/"${GREP_RECURSIVE_CHAR:-}" 2>/dev/null |grep -vw "${dir}"/id_rsa)"
|
||||
SSH_PRIVATE_KEYS="${SSH_PRIVATE_KEYS:-} ${dir}/id_rsa $(grep -l${GREP_RECURSIVE_FLAG:-} 'PRIVATE KEY' "${dir}/"${GREP_RECURSIVE_CHAR:-} 2>/dev/null |grep -vw "${dir}"/id_rsa)"
|
||||
done
|
||||
# shellcheck disable=SC2086
|
||||
printf '%s\n' ${SSH_PRIVATE_KEYS} |while read -r file; do
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
# file: tasks/group.yml
|
||||
|
||||
- name: group - create dns group
|
||||
group: gid="11" name="dns" state="present" system="yes"
|
||||
become: yes
|
||||
when: ansible_os_family|lower != "alpine"
|
||||
|
||||
- name: group - add me to the dns group
|
||||
user: name="{{ansible_user_id}}" groups=dns append=yes
|
||||
become: yes
|
||||
when: ansible_os_family|lower != "alpine" and ansible_user_uid != "0"
|
||||
@@ -52,6 +52,7 @@
|
||||
- name: user - update ~/.bashrc
|
||||
with_items:
|
||||
- PS1="╭∩╮$PS1"
|
||||
- source .shrc
|
||||
- unset user_count process_count
|
||||
lineinfile: dest=~/.bashrc create=yes line='{{item}}'
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ package:
|
||||
installed: true
|
||||
groff:
|
||||
installed: true
|
||||
ncurses:
|
||||
installed: true
|
||||
openssh-client:
|
||||
installed: true
|
||||
py3-pip:
|
||||
|
||||
@@ -7,8 +7,12 @@ package:
|
||||
installed: true
|
||||
openssh-client:
|
||||
installed: true
|
||||
pass:
|
||||
installed: true
|
||||
python-pip:
|
||||
installed: true
|
||||
rclone:
|
||||
installed: true
|
||||
util-linux:
|
||||
installed: true
|
||||
vim-nox:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
hosts_packages_distro:
|
||||
- { "name": "coreutils", "state": "present" }
|
||||
- { "name": "groff", "state": "present" }
|
||||
- { "name": "ncurses", "state": "present" }
|
||||
- { "name": "openssh-client", "state": "present" }
|
||||
- { "name": "py3-pip", "state": "present" }
|
||||
- { "name": "util-linux", "state": "present" }
|
||||
|
||||
@@ -5,7 +5,9 @@ hosts_packages_distro:
|
||||
- { "name": "coreutils", "state": "present" }
|
||||
- { "name": "groff", "state": "present" }
|
||||
- { "name": "openssh-client", "state": "present" }
|
||||
- { "name": "pass", "state": "present" }
|
||||
- { "name": "python-pip", "state": "present" }
|
||||
- { "name": "rclone", "state": "present" }
|
||||
- { "name": "util-linux", "state": "present" }
|
||||
- { "name": "vim-nox", "state": "present" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user