I am currently not able to login to my super user. Here is the sequence of events
~ su
password:
su: using restricted shell which zsh
su: failed to execute which zsh: No such file or directory
Previously I was trying to automate with ansible.
- hosts: localhost
become: true
tasks:
- name: Install zsh
apt: name=zsh
- name: change shell
shell: chsh -s `which zsh`
- name: Install ohmyzsh autosuggestions plugin
ansible.builtin.git:
repo: 'https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/plugins/zsh-autosuggestions'
dest: "~/.oh-my-zsh/plugins/zsh-autosuggestions"
- name: Update our zshrc
shell: sed -i 's/(git/(git zsh-autosuggestions' ~/.zshrc
When I was running my playbook, sometimes it would fail on the tasks portion
PLAY [localhost] ***************************************************************
TASK [Gathering Facts] *********************************************************
fatal: [localhost]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"failed": true, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}
PLAY RECAP *********************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
and sometimes it gets to the chsh section (I think its when I change my shell or create an alias for python or change the ansible script (get rid of certain steps). I don't fully understand it but it gives me this error for the chsh section
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "chsh -s `which zsh`", "delta": "0:00:00.006789", "end": "2023-08-03 19:46:19.294159", "msg": "non-zero return code", "rc": 1, "start": "2023-08-03 19:46:19.287370", "stderr": "Password: chsh: PAM: Authentication failure", "stderr_lines": ["Password: chsh: PAM: Authentication failure"], "stdout": "", "stdout_lines": []}
Overall there are two things I would like to fix, for one by super user account, but secondly the ansible script so this does not happen again