fix make install

This commit is contained in:
aynic.os
2022-06-04 02:24:35 +02:00
parent ff1da1fc3c
commit 14a4f86524
20 changed files with 46 additions and 84 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
ANSIBLE_APP_TYPE ?= myos
ANSIBLE_ARGS ?= $(if $(filter-out 0,$(UID)),$(if $(shell sudo -l 2>/dev/null |grep 'NOPASSWD: ALL'),,--ask-become-pass))$(if $(DOCKER_RUN),$(if $(shell ssh-add -l >/dev/null 2>&1 || echo false), --ask-pass))
ANSIBLE_AWS_ACCESS_KEY_ID ?= $(AWS_ACCESS_KEY_ID)
ANSIBLE_AWS_DEFAULT_OUTPUT ?= $(AWS_DEFAULT_OUTPUT)
@@ -29,7 +30,7 @@ ANSIBLE_USERNAME ?= $(USER)
ANSIBLE_VERBOSE ?= $(if $(DEBUG),-vvvv,$(if $(VERBOSE),-v))
CMDS += ansible ansible-playbook
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_MYOS 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
ENV_VARS += ANSIBLE_APP_TYPE 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_MYOS 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
define ansible
+1 -1
View File
@@ -13,7 +13,7 @@
ignore_errors: true
- name: config - add docker daemon storage configuration
when: false and docker_package|length > 0
when: docker_package|length > 0
template:
src: daemon.json.j2
dest: "{{docker_daemon_config_file}}"
-14
View File
@@ -1,20 +1,6 @@
---
# file: tasks/files.yml
- name: files - copy files
with_items:
- /usr/local/bin/docker-build
- /usr/local/bin/docker-cleanup
- /usr/local/bin/docker-cleanup-images
- /usr/local/bin/docker-cleanup-volumes
- /usr/local/bin/docker-log-cleanup
- /usr/local/bin/docker-log-truncate
- /usr/local/bin/docker-run
- /usr/local/bin/docker-get-image
- /usr/local/bin/docker-get-status
copy: src=../files/{{item}} dest={{item}} owner=root group=root mode=0755
become: yes
- name: files - copy sysctl configuration files
with_items:
- /etc/sysctl.d/docker.conf
+4 -3
View File
@@ -1,11 +1,12 @@
# shellcheck shell=bash source=/dev/null
# ~/.bash_profile: executed by the command interpreter for bash login shell.
[ -f ~/.profile ] && source ~/.profile
[ -f ~/.sh_profile ] && . ~/.sh_profile
# bash-completion
if ! shopt -oq posix && [ -z "${BASH_COMPLETION_VERSINFO-}" ]; then
if [ ${BASH_VERSINFO[0]} -gt 4 ] \
|| [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
if [ "${BASH_VERSINFO[0]}" -gt 4 ] \
|| { [ "${BASH_VERSINFO[0]}" -eq 4 ] && [ "${BASH_VERSINFO[1]}" -ge 1 ] ;}; then
shopt -q progcomp && for file in \
/{*/local,usr}/share/bash-completion/bash_completion \
/etc/bash_completion; do
@@ -1,7 +0,0 @@
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
@@ -1 +0,0 @@
alias ctop='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock:ro quay.io/vektorlab/ctop:latest'
@@ -1,4 +1,5 @@
# ~/.profile: executed by the command interpreter for login shells.
# shellcheck shell=sh source=/dev/null
# ~/.sh_profile: executed by the command interpreter for login shells.
# set -x
# source ~/.*aliases and ~/.*functions files
@@ -24,7 +25,7 @@ for file in "$HOME"/.*shrc; do
# remove $HOME/. prefix from file
file="${file#${HOME}/.}"
# source file if match current shell
[ "$(basename ${SHELL})" = "${file%rc}" ] && . "${HOME}/.$file"
[ "$(basename "${SHELL}")" = "${file%rc}" ] && . "${HOME}/.$file"
done
# set PATH to include user's bin
-1
View File
@@ -1 +0,0 @@
alias vi='vim'
+4 -8
View File
@@ -1,4 +1,5 @@
#!/bin/bash
# shellcheck source=/dev/null disable=SC2046
### BEGIN INIT INFO
# Provides: myos
# Required-Start: docker
@@ -8,16 +9,11 @@
# Description: MYOS system calls
### END INIT INFO
set -e
# check system config
[ -r /etc/default/myos ] && . /etc/default/myos || exit 1
type make >/dev/null 2>&1 && [ -d "${MYOS}" ] || exit 2
# load user config
[ -r ~/.myos ] && . ~/.myos
[ -r /etc/default/myos ] && . /etc/default/myos 2>/dev/null
type make >/dev/null 2>&1 && [ -d "${MYOS}" ] || exit 1
case "$1" in
*)
IFS=$'\n'; exec sh -c "cd ${MYOS} && exec make $@ $(cat /etc/default/myos ~/.myos 2>/dev/null)"
IFS=$'\n'; cd "${MYOS}"; exec env $(cat /etc/default/myos ~/.myos 2>/dev/null) make "$@"
esac
@@ -254,7 +254,8 @@ ssh_del() {
tmux_attach() {
command -v tmux >/dev/null 2>&1 || return
TMUX_SESSION="$(id -nu)@$(hostname |sed 's/\..*//')"
if [ -z "${TMUX}" ]; then
# do not attach tmux in screen ;)
if [ -z "${TMUX}" -a -z "${STY}" ]; then
printf 'Attaching tmux.' && sleep 1\
&& printf '.' && sleep 1\
&& printf '.' && sleep 1
+1 -11
View File
@@ -1,19 +1,9 @@
---
# file: tasks/config.yml
- name: config - do not run docker-compose in docker - arch != x86
when: ansible_machine|lower != "x86_64"
with_items:
- DOCKER=false
lineinfile:
path: /etc/default/myos
create: yes
line: '{{ item }}'
mode: '0644'
become: yes
- name: config - set MYOS config in /etc/default/myos
with_items:
- APP_TYPE={{ lookup('env','ANSIBLE_APP_TYPE') }}
- MYOS={{ lookup('env','ANSIBLE_MYOS') }}
lineinfile:
path: /etc/default/myos
+1 -1
View File
@@ -5,7 +5,7 @@
with_items: "{{ hosts_git_repositories|default([]) }}"
git:
repo: "{{ item.repo }}"
dest: "{{ item.dest|default('/dns') }}"
dest: "{{ item.dest }}"
umask: "022"
key_file: "{{ item.key_file|default('~/.ssh/id_rsa') }}"
version: "{{ item.version|default('HEAD') }}"
+7 -5
View File
@@ -34,21 +34,23 @@
- name: user - copy ~/.*aliases ~/.*profile ~/.shrc
with_items:
- ".dircolors_aliases"
- ".docker_aliases"
- ".vim_aliases"
- ".bash_profile"
- ".profile"
- ".sh_profile"
- ".shrc"
copy: src=../files/{{item}} dest=~/{{item}} mode="0640" backup="yes"
- name: user - update ~/.bashrc
with_items:
- PS1="╭∩╮$PS1"
- source .shrc
- source ~/.shrc
- unset user_count process_count
lineinfile: dest=~/.bashrc create=yes line='{{item}}'
- name: user - update ~/.profile
with_items:
- source ~/.sh_profile
lineinfile: dest=~/.profile create=yes line='{{item}}'
- name: user - update ~/.config/git/ignore
with_items:
- '.nfs*'
+1 -1
View File
@@ -5,7 +5,7 @@
with_items: "{{ git_repositories|default([]) }}"
git:
repo: "{{ item.repo }}"
dest: "{{ item.dest|default('/src') }}"
dest: "{{ item.dest }}"
umask: "022"
key_file: "{{ item.key_file|default('~/.ssh/id_rsa') }}"
version: "{{ item.version|default('HEAD') }}"