Paramiko SSH client I wrote a sub class from paramiko in order add on functionality to assist myself to work with Ansible AWX 9.2.0 (dockerless version). The subclass works with my CentOS which hosts the Ansible AWX, the purpose is to use the SSHClient class to download and upload playbooks, check the existence of project … Continue reading [python]Paramiko’s SSHClient
Tag: Ansible
[ansible]apt update && apt install tree
This can be applied to install package from apt repo. I have three ubuntu servers under the group linux. YAML file Reference: https://docs.ansible.com/ansible/latest/modules/apt_module.html Execution Result The ansible python script is sent from the control node to the ubuntu servers, this is the default behaviour, unless the connection is like network_cli then the control node executes … Continue reading [ansible]apt update && apt install tree
[ansible] userdel -r unixadm
This is a reverse of the previous post. Reference: https://docs.ansible.com/ansible/latest/modules/user_module.html YAML file Execution The execution is ansible-playbook lab3.yaml -K where -K is to prompt for the sudo password. Result
[ansible] Doing useradd with multiple linux servers
Inventory [linux] ubs1 ubs2 ubs3 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.25 ubs1 192.168.1.26 ubs2 192.168.1.27 ubs3 There are predefined linux servers hostnames, these hostnames have to be within the /etc/ansible/hosts in order to execute the yaml. Yaml for creating user I used an online mkpasswd to generate the hash for … Continue reading [ansible] Doing useradd with multiple linux servers
[ansible] Some basic command line
For issuing commands to linux ansible -m command -a "uname -a" localhost -u cyruslab -k -m is the module -a is the arguments, in this case we are issuing linux command uname -a -u is the username -k is ask for password localhost is the ip address or hostname or the group name, the target … Continue reading [ansible] Some basic command line
[python]Show version with Ansible
Introduction These python scripts do the following: init_vault.py, initialized the vault and create an encryption key. The initialization creates 5 keys and 1 root token for unsealing and login the vault respectively. get_vault_resuly.py, this script gets the keys and token to unseal and login the vault. vault_mgmt.py, this script gets the key and value pair … Continue reading [python]Show version with Ansible