Open tbennett6421 opened 2 years ago
My setup for the minions involves adding the ubuntu salt-minion package to add the hosts to the salt master, then running a state file to apply the latest salt-minon. This minion was provisioned using the following relevant state files.
{% set state_context = "base" %}
{% set state_folder = "apt" %}
{% set state_name = "saltstack" %}
{% set state_id = state_context ~ "@" ~ state_folder ~ "/" ~ state_name ~ ".sls" %}
# variables
{% set hostname = grains.host %}
{% set apt_humanname = "Saltstack Repo" %}
{% set apt_dstfile = "/etc/apt/sources.list.d/saltstack.list" %}
{% if grains['osfinger'] == 'Ubuntu-22.04' %}
{% set os = "ubuntu" %}
{% set osnum = "22.04" %}
{% set codename = "jammy" %}
{% set codename_full = "jammy jellyfish" %}
{% endif %}
## For 22.04: use apt-key-signing
{% if grains['osfinger'] == 'Ubuntu-22.04' %}
{% set key_src = "https://repo.saltproject.io/salt/py3/ubuntu/" ~ osnum ~ "/amd64/3005/salt-archive-keyring.gpg" %}
{% set key_dst = "/usr/share/keyrings/salt-archive-keyring.gpg" %}
{% set key_hash = "67fff8c170554427b61a83dcb8430d85e6a00453"%}
{% endif %}
{{state_id}}//saltstack_pkgrepo_key_{{osnum}}:
file.managed:
- name: {{key_dst}}
- source: {{key_src}}
- source_hash: {{key_hash}}
{{state_id}}//saltstack_pkgrepo_{{osnum}}:
pkgrepo.managed:
- humanname: {{apt_humanname}}
- name: deb [signed-by={{key_dst}} arch=amd64] https://repo.saltproject.io/salt/py3/{{os}}/{{osnum}}/amd64/3005 {{codename}} main
- file: {{ apt_dstfile }}
- key_url: {{key_src}}
- architectures: amd64
- aptkey: False
- require:
- file: {{state_id}}//saltstack_pkgrepo_key_{{osnum}}
- require_in:
- pkg: {{state_id}}//salt.minion
{{state_id}}//salt.minion:
pkg.latest:
- name: salt-minion
- refresh: True
pdbedit
needs to be found on the salt-minion
's PATH
.
I believe 22.04 changed the default behaviour so that root
has a reduced PATH
.
A change to the service definition is probably required.
user@host:~$ pdbedit -V
Version 4.15.9-Ubuntu
user@hots:~$ which pdbedit
/usr/bin/pdbedit
root@host:~# pdbedit -V
Version 4.15.9-Ubuntu
root@host:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Unless the salt-minion has a different PATH then root's default (like cron) that doesn't seem to be it. Is there are way to modify salt's environment such as the following in ansible?
- name: Execute task with extended PATH
shell: echo $PATH
environment:
PATH: "/usr/other/bin:{{ ansible_env.PATH }}"
user@salt:~$ sudo salt 'host' cmd.run "echo $PATH"
jid: 20221031181410828213
host:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Also dealing with this, traced it down to https://stackoverflow.com/questions/69938570/md4-hashlib-support-in-python-3-8 when working with the newer onedir install.
OS: Arch Linux Can report to have the same issue (actually since 2022.11.20 already, but did not find the time to look at it) I can also report that the workaround posted by @greenaar works. Edit your /etc/ssl/openssl.cnf accordingly and restart the salt-minion.service
is this the related upstream issue? https://bugs.python.org/issue47101
Description
Unable to use pdbedit.managed on Ubuntu 22.04.1 LTS minion
Setup
OS Version
Samba Version
pdbedit version
Relevant state file
Please be as specific as possible and give set-up details.
vmware esxi
Steps to Reproduce the behavior
apt install samba -y
salt 'ubuntu22' state.apply roles/smb/smb-users
Expected behavior
Updates the samba database with the user/password in the state
Versions Report
Salt Master:
Salt Minion: