Difference between revisions of "Ansible"
Jump to navigation
Jump to search
| Line 6: | Line 6: | ||
``` | ``` | ||
| − | Or lets just use pip | + | Or lets just use Python Source of latest, pip |
``` | ``` | ||
| − | python3 -m venv venv | + | #!/usr/bin/env bash |
| + | set -e pipefail | ||
| + | |||
| + | version='3.9.6' | ||
| + | |||
| + | get() { | ||
| + | sudo apt install -y build-essential checkinstall | ||
| + | sudo apt install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev \ | ||
| + | libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev | ||
| + | |||
| + | curl -LO https://www.python.org/ftp/python/$version/Python-$version.tgz | ||
| + | tar xzf Python-$version.tgz | ||
| + | } | ||
| + | |||
| + | install() { | ||
| + | cd Python-$version | ||
| + | ./configure --prefix=/usr/local | ||
| + | #./configure --prefix=/usr/local --enable-optimizations | ||
| + | sudo make altinstall | ||
| + | } | ||
| + | |||
| + | get | ||
| + | install | ||
| + | ``` | ||
| + | |||
| + | ``` | ||
| + | python3.9 -m venv venv | ||
source ansible/bin/activate | source ansible/bin/activate | ||
| − | pip install -U pip | + | # pip install -U pip |
pip install ansible | pip install ansible | ||
``` | ``` | ||
Revision as of 20:27, 1 July 2021
Install and Use
Using apt and older version
sudo apt install ansible sshpass
Or lets just use Python Source of latest, pip
#!/usr/bin/env bash
set -e pipefail
version='3.9.6'
get() {
sudo apt install -y build-essential checkinstall
sudo apt install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
curl -LO https://www.python.org/ftp/python/$version/Python-$version.tgz
tar xzf Python-$version.tgz
}
install() {
cd Python-$version
./configure --prefix=/usr/local
#./configure --prefix=/usr/local --enable-optimizations
sudo make altinstall
}
get
install
python3.9 -m venv venv source ansible/bin/activate # pip install -U pip pip install ansible
inventory.txt
[Windows] winhost.example.com [Windows:vars] ansible_user=<myuser> ansible_password=<mypass> ansible_connection=winrm # ansible_port=5985 # ansible_winrm_scheme=http ansible_port=5986 ansible_winrm_scheme=https ansible_winrm_server_cert_validation: ignore [Linux] linuxhost.example.com [Linux:vars] ansible_user=<my user> ansible_password=<my pass> ansible_connection=ssh
https://www.vgemba.net/ansible/Ansible-WinRM-Workgroup/
ansible 'Windows' --inventory-file inventory.txt -a "pwd"
ansible myhost.example.com -a "pwd" --ask-pass