Browse Source

+ yadm initialization for non priveleged and existing users

#861m7vaer Шаблон операционной системы на Debian 10
master
dimti 9 months ago
parent
commit
fb93943ba5
  1. 0
      playbooks/nginx-without-db-site.yml
  2. 6
      playbooks/own/yadm.yml
  3. 2
      playbooks/yadm.yml
  4. 2
      run-lxc-playbook.sh
  5. 8
      run-playbook.sh
  6. 6
      run-site-playbook.sh
  7. 8
      yadm.yml

0
playbooks/nginx-site-without-db.yml → playbooks/nginx-without-db-site.yml

6
playbooks/own/yadm.yml

@ -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

@ -0,0 +1,2 @@
---
- import_playbook: own/yadm.yml

2
run-lxc-playbook.sh

@ -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
) )

8
run-playbook.sh

@ -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
) )

6
run-site-playbook.sh

@ -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

8
yadm.yml

@ -1,8 +0,0 @@
---
- import_playbook: debops/yadm.yml
- import_playbook: debops/users.yml
- import_playbook: debops/sudo.yml
# Import all other group playbooks in this file...
...
Loading…
Cancel
Save