Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer installing wrong version of ansible #323

Open
PravinRanjan10 opened this issue Jan 10, 2020 · 7 comments · May be fixed by #338
Open

Installer installing wrong version of ansible #323

PravinRanjan10 opened this issue Jan 10, 2020 · 7 comments · May be fixed by #338
Assignees
Labels
bug Something isn't working
Milestone

Comments

@PravinRanjan10
Copy link

Describe the bug
A clear and concise description of what the bug is.

If i select backend as ceph, and the ceph version is stable-3.1, ansible verion should be 2.4.x
But at the end it is always installing ansible 2.5.1 version.(Which should not).
Our script is identifying that, ansible 2.4 should be installed but at end installing 2.5.1 version.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@PravinRanjan10
Copy link
Author

oot@root1-Latitude-E7450:~/opensds-installer/ansible# chmod +x ./install_ansible.sh && ./install_ansible.sh
Reading...: /root/opensds-installer/ansible/group_vars/osdsdock.yml
Installing ansible 2.4 required for ceph-ansible stable-3.1 branch.
.
.
.

After this operation, 26.9 MB of additional disk space will be used.
Selecting previously unselected package ansible.
(Reading database ... 213240 files and directories currently installed.)
Preparing to unpack .../ansible_2.5.1+dfsg-1ubuntu0.1_all.deb ...
Unpacking ansible (2.5.1+dfsg-1ubuntu0.1) ...
Setting up ansible (2.5.1+dfsg-1ubuntu0.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
ansible 2.5.1
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/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@root1-Latitude-E7450:~/opensds-installer/ansible#
root@root1-Latitude-E7450:/opensds-installer/ansible# ansible --version
ansible 2.5.1
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/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]

@PravinRanjan10
Copy link
Author

@joseph-v

@thatsdone
Copy link
Contributor

Hi @PravinRanjan10,

Two questions.

Q1. Do you have NON snipped version terminal log?
install_ansible.sh shows the ppa repository being used like the bottom.

Q2. Which Ubuntu version are you using? Xenial? or Bionic?

install_ansible.sh executes apt commands like below:

# incorrect version removed, or no ansible found.
echo Installing ansible ${REQUIRED_ANSIBLE_VER} required for ceph-ansible ${CEPH_ANSIBLE_BRANCH} branch.
sudo add-apt-repository -y ppa:ansible/ansible-${REQUIRED_ANSIBLE_VER}
sudo apt-get update
sudo apt-get install -y ansible
sleep 3
sudo add-apt-repository -y -r ppa:ansible/ansible-${REQUIRED_ANSIBLE_VER}

In this case, REQUIRED_ANSIBLE_VER is '2.4', so this is strange.

But, according to the ansible official ppa site information:

https://launchpad.net/~ansible/+archive/ubuntu/ansible-2.4

I guess now ansible 2.5 could be installed in case of Bionic.
Please note that install_ansible.sh was tested under Xenial.
But, anyway this is an issue to be fixed.
You can assign me to this issue.

Terminal log of 'install_ansible.sh'on Ubuntu Xenial in my lab.

ubuntu@ubuntu201:~/opensds-installer/ansible$ bash install_ansible.sh
Reading...: /home/ubuntu/opensds-installer/ansible/group_vars/osdsdock.yml
Installing ansible 2.4 required for ceph-ansible stable-3.1 branch.
gpg: keyring `/tmp/tmpmnqv52j0/secring.gpg' created
gpg: keyring `/tmp/tmpmnqv52j0/pubring.gpg' created
gpg: requesting key 7BB9C367 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpmnqv52j0/trustdb.gpg: trustdb created
gpg: key 7BB9C367: public key "Launchpad PPA for Ansible, Inc." imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Get:2 http://ppa.launchpad.net/ansible/ansible-2.4/ubuntu xenial InRelease [18.0
 kB]
Hit:3 http://nova.clouds.archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:6 http://ppa.launchpad.net/ansible/ansible-2.4/ubuntu xenial/main amd64 Pack
ages [540 B]
Get:7 http://ppa.launchpad.net/ansible/ansible-2.4/ubuntu xenial/main Translatio
n-en [344 B]
Fetched 18.9 kB in 1s (9,741 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
(snip)

@PravinRanjan10
Copy link
Author

@thatsdone, The detail of machine is below:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic

As per discussion, please take a look

@thatsdone
Copy link
Contributor

thatsdone commented Jan 13, 2020

@PravinRanjan10

Hi, I figured out the root cause and a quick workaround.

This issue comes from the default distro bundled version of ansible. Ubuntu bionic bundles ansible 2.5 series, and we need to specify exact version when we want to use a downgraded version like below.

ubuntu@ubuntu203:~/opensds-installer/ansible$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

ubuntu@ubuntu203:~/opensds-installer/ansible$ sudo add-apt-repository -y ppa:ansible/ansible-2.4
  (snip)
ubuntu@ubuntu203:~/opensds-installer/ansible$ sudo apt-get -y install ansible=2.4.6.0-1ppa~bionic
Reading package lists... Done
Building dependency tree
Reading state information... Done
  (snip)
Setting up ansible (2.4.6.0-1ppa~bionic) ...
ubuntu@ubuntu203:~/opensds-installer/ansible$
ubuntu@ubuntu203:~/opensds-installer/ansible$ ansible --version
ansible 2.4.6.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/ubuntu/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Nov  7 2019, 10:07:09) [GCC 7.4.0]
ubuntu@ubuntu203:~/opensds-installer/ansible$

I don't think this is the reason why you got #326 , but anyway I will update 'install_ansible.sh' soon.

Here is a (manual) workaround procedure.

  1. Identify your preferred ansible verson.
    • In your case, it should be 2.4
  2. Add appropriate ppa repository.
    • `sudo add-apt-repository -y ppa:ansible/ansible-2.4
  3. run apt-get update
  4. check the package version
    • apt-cache showpkg ansible | grep 2.4
    • Now the up-to-date ppa version of 2.4 series seems to be '2.4.6.0-1ppa~bionic'
  5. Install the exact version ansible by specifying package version above.
    • sudo apt-get -y install ansible=2.4.6.0-1ppa~bionic
  6. Check version of the installed ansible
    • ansible --version

Regards,

@thatsdone
Copy link
Contributor

thatsdone commented Feb 9, 2020

Sorry for my (very) late action. I created a PR for this issue.

@kumarashit
Copy link
Collaborator

@PravinRanjan10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants