Skip to content

Commit df96cef

Browse files
committed
fix(ansible): bootstrap requires -e for both user and key, not --private-key
1 parent 18c5be9 commit df96cef

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

infra/ansible/playbook.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
#
44
# Bootstrap (first time — fresh VPS, only root exists):
55
# ansible-playbook playbook.yml -i inventory.local.ini -e @vars/local.yml \
6-
# -e ansible_user=root --private-key ~/.ssh/id_rsa
7-
# NOTE: -u root does NOT work — ansible_user in inventory is a host variable
8-
# that overrides it. -e ansible_user=root uses extra-vars precedence instead.
9-
# --private-key overrides ansible_ssh_private_key_file (abc_deploy != root key).
6+
# -e ansible_user=root \
7+
# -e ansible_ssh_private_key_file=~/.ssh/id_rsa
8+
# NOTE: -u/--user and --private-key are NOT enough — inventory host vars have
9+
# higher precedence. Override both with -e (extra vars beat host vars).
10+
# ansible_ssh_common_args has IdentitiesOnly=yes so only the named key is tried.
1011
#
1112
# All subsequent runs (root SSH is disabled after base role runs):
1213
# ansible-playbook playbook.yml -i inventory.local.ini -e @vars/local.yml

0 commit comments

Comments
 (0)