Stop the delegated frontend build from sudoing on the control machine
pi_standard_setup's defaults set `ansible_become: true`. Role defaults are
play-wide host variables, and in Ansible's precedence the `ansible_become`
variable outranks the `become` keyword - so the `become: false` on every
pi_musicmouse task delegated to localhost was silently overridden and each one
tried to sudo on the machine running ansible:
Premature end of stream waiting for become success or become password prompt
Those defaults earn their keep bootstrapping a fresh Pi, where you connect as
`pi` and become root to enable root login, so override the variable on the
delegated tasks rather than removing them.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
chdir: "{{ pi_musicmouse_build_cache }}/{{ musicmouse_version | regex_replace('/', '_') }}/web"
|
chdir: "{{ pi_musicmouse_build_cache }}/{{ musicmouse_version | regex_replace('/', '_') }}/web"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
become: false
|
become: false
|
||||||
|
vars:
|
||||||
|
ansible_become: false # see the first delegated task in tasks/main.yml
|
||||||
changed_when: true
|
changed_when: true
|
||||||
notify: Compile frontend
|
notify: Compile frontend
|
||||||
|
|
||||||
@@ -20,6 +22,8 @@
|
|||||||
chdir: "{{ pi_musicmouse_build_cache }}/{{ musicmouse_version | regex_replace('/', '_') }}/web"
|
chdir: "{{ pi_musicmouse_build_cache }}/{{ musicmouse_version | regex_replace('/', '_') }}/web"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
become: false
|
become: false
|
||||||
|
vars:
|
||||||
|
ansible_become: false # see the first delegated task in tasks/main.yml
|
||||||
changed_when: true
|
changed_when: true
|
||||||
notify: Sync frontend
|
notify: Sync frontend
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,14 @@
|
|||||||
mode: "0755"
|
mode: "0755"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
become: false
|
become: false
|
||||||
|
vars:
|
||||||
|
# `become: false` above is not enough on its own. pi_standard_setup's defaults set
|
||||||
|
# `ansible_become: true`, role defaults are play-wide host variables, and the
|
||||||
|
# `ansible_become` *variable* outranks the `become` *keyword* in Ansible's
|
||||||
|
# precedence - so every task here tried to sudo on the control machine. Those
|
||||||
|
# defaults are needed to bootstrap a fresh Pi (connect as `pi`, become root, enable
|
||||||
|
# root login), so override the variable here rather than removing them.
|
||||||
|
ansible_become: false
|
||||||
|
|
||||||
- name: Checkout Musicmouse repo for frontend build (control machine)
|
- name: Checkout Musicmouse repo for frontend build (control machine)
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
@@ -129,6 +137,8 @@
|
|||||||
force: true
|
force: true
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
become: false
|
become: false
|
||||||
|
vars:
|
||||||
|
ansible_become: false # see the first delegated task in tasks/main.yml
|
||||||
notify: Build frontend
|
notify: Build frontend
|
||||||
|
|
||||||
- name: Samba setup
|
- name: Samba setup
|
||||||
|
|||||||
Reference in New Issue
Block a user