На моем Ubuntu 18.04 установлена Ansible 2.8.3.
[root:~] # ansible --version
ansible 2.8.3
config file = None
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.15+ (default, Oct 7 2019, 17:39:04) [GCC 7.4.0]
Конечно, я могу удалить этот пакет, используя apt
[root:~] # apt remove ansible
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
python-httplib2 python-jinja2 python-markupsafe python-paramiko python-pyasn1 python-yaml sshpass
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
ansible
0 upgraded, 0 newly installed, 1 to remove and 343 not upgraded.
After this operation, 58.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 317908 files and directories currently installed.)
Removing ansible (2.9.6-1ppa~bionic) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
[root:~] #
И я могу установить другую версию, например, 2.9.6
[root:~] # apt install ansible=2.9.6-1ppa~bionic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
ansible
0 upgraded, 1 newly installed, 0 to remove and 343 not upgraded.
Need to get 0 B/5,786 kB of archives.
After this operation, 58.0 MB of additional disk space will be used.
Selecting previously unselected package ansible.
(Reading database ... 311783 files and directories currently installed.)
Preparing to unpack .../ansible_2.9.6-1ppa~bionic_all.deb ...
Unpacking ansible (2.9.6-1ppa~bionic) ...
Setting up ansible (2.9.6-1ppa~bionic) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
[root:~] #
Проблема в том, что установка 2.9.6-1ppa~bionic
вернет только версию 2.8.3.
[root:~] # ansible --version
ansible 2.8.3
config file = None
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.15+ (default, Oct 7 2019, 17:39:04) [GCC 7.4.0]
[root:~] #
Таким образом, следует сделать вывод, что apt remove ansible
не удалит полностью 2.8.3. Эта версия все еще установлена и готова к активации, если выполняется еще один apt install ansible
.
Есть ли способ полностью удалить Ansible 2.8.3? Если не считать полной переустановки Ubuntu 18.04?
Кстати, я установил 2.8.3 с использованием официального репозитория Ansible
[root:~] # cat /etc/apt/sources.list.d/ansible.list
deb "http://ppa.launchpad.net/ansible/ansible/ubuntu" bionic main
[root:~] #
Используя Chef BTW, я управляю всеми своими системами с помощью Chef. Итак, Ansible был установлен с использованием apt и официального репозитория Ansible.
apt_repository 'ansible' do
uri 'ppa:ansible/ansible'
distribution node['lsb']['codename']
end
package ['ansible','python-pip']