+ yadm initialization for non priveleged and existing users
#861m7vaer Шаблон операционной системы на Debian 10
This commit is contained in:
6
playbooks/own/yadm.yml
Normal file
6
playbooks/own/yadm.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- hosts: [ 'debian10' ]
|
||||||
|
tasks:
|
||||||
|
- name: Clone dotfiles repo
|
||||||
|
shell: yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git
|
||||||
|
# TODO: убрать sudo для автовключения тмукса из .bashrc
|
2
playbooks/yadm.yml
Normal file
2
playbooks/yadm.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- import_playbook: own/yadm.yml
|
@ -42,7 +42,7 @@ if [[ ! -f "$PLAYBOOK" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
COMMAND=$(cat <<EOF
|
COMMAND=$(cat <<EOF
|
||||||
ansible-playbook -e "lxc_host=$LXC_HOST" -e runner=lxc --ssh-common-args="-o ProxyCommand='ssh -W %h:%p -q root@$SERVER'" $PLAYBOOK
|
ansible-playbook -e "lxc_host=$LXC_HOST" -e="domain_name=$LXC_HOST" -e runner=lxc --ssh-common-args="-o ProxyCommand='ssh -W %h:%p -q root@$SERVER'" $PLAYBOOK
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
SERVER=$1
|
SERVER=$1
|
||||||
PLAYBOOK=$2
|
PLAYBOOK=$2
|
||||||
SITE_NAME=$3
|
USER=$3
|
||||||
|
|
||||||
while [[ "$#" -gt 0 ]]; do
|
while [[ "$#" -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@ -28,8 +28,12 @@ if [[ -z "$PLAYBOOK" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$USER" ]]; then
|
||||||
|
USER=root
|
||||||
|
fi
|
||||||
|
|
||||||
COMMAND=$(cat <<EOF
|
COMMAND=$(cat <<EOF
|
||||||
ansible-playbook -e "lxc_host=${SERVER} -e runner=normal"
|
ansible-playbook -e "lxc_host=${SERVER}" -e "runner=normal" -e "ansible_user=${USER}"
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -43,6 +43,12 @@ if [[ -z "$DOMAIN_NAME" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "$PLAYBOOK" ]]; then
|
||||||
|
echo "Playbook file is not exists: $PLAYBOOK"
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
COMMAND=$(cat <<EOF
|
COMMAND=$(cat <<EOF
|
||||||
ansible-playbook -e "lxc_host=${SERVER}" -e "initial_site_name=${SITE_NAME}" -e "domain_name=${DOMAIN_NAME}" -e runner=site
|
ansible-playbook -e "lxc_host=${SERVER}" -e "initial_site_name=${SITE_NAME}" -e "domain_name=${DOMAIN_NAME}" -e runner=site
|
||||||
EOF
|
EOF
|
||||||
|
Reference in New Issue
Block a user