StackStorm / ansible-st2

Ansible Roles and Playbooks to deploy StackStorm
https://galaxy.ansible.com/StackStorm/stackstorm/
Apache License 2.0
100 stars 77 forks source link

Should Erlang packages in Ubuntu 20.04 be held at a specific version or not? #315

Closed b2ag closed 2 years ago

b2ag commented 2 years ago

Hi,

I added the roles from this repository to my playbook which installs some stuff upfront and updates the system. First run on a clean container runs fine but I can't reach idempotence because it fails the Install pinned erlang packages on Ubuntu step. I have a task which updates the system which also updates erlang in the second run. Running apt-mark showhold shows nothing so I guess the expected version of erlang packages isn't actually set to hold by the tasks in this repo. As I am new to StackStorm (just want to give it a try) I'm unsure what the Install pinned erlang packages on Ubuntu step actually tries to achieve. Can you shed some light?

apt upgrade wants to install:

The following packages will be upgraded:
  erlang-asn1 erlang-base erlang-crypto erlang-eldap erlang-ftp erlang-inets
  erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key erlang-runtime-tools
  erlang-snmp erlang-ssl erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl

Second ansible run fails at

TASK [StackStorm.rabbitmq : Install pinned erlang packages on Ubuntu] *************************
"failed":[
   10.24.14.9
]"(item=erlang-base) =>"{
   "ansible_loop_var":"item",
   "attempts":5,
   "cache_update_time":1654980669,
   "cache_updated":false,
   "changed":false,
   "item":"erlang-base",
   "msg":"'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"       install 'erlang-base=1:24.*'' failed: E: Packages were downgraded and -y was used without --allow-downgrades.\n",
   "rc":100,
   "stderr":"E: Packages were downgraded and -y was used without --allow-downgrades.\n",
   "stderr_lines":[
      "E: Packages were downgraded and -y was used without --allow-downgrades."
   ],
   "stdout":"Reading package lists...\nBuilding dependency tree...\nReading state information...\nSuggested packages:\n  erlang-tools erlang erlang-manpages erlang-doc\nRecommended packages:\n  erlang-crypto erlang-syntax-tools\nThe following packages will be REMOVED:\n  erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets erlang-mnesia\n  erlang-os-mon erlang-parsetools erlang-public-key erlang-runtime-tools\n  erlang-snmp erlang-ssl erlang-syntax-tools erlang-tftp erlang-tools\n  erlang-xmerl rabbitmq-server\nThe following packages will be DOWNGRADED:\n  erlang-base\n0 upgraded, 0 newly installed, 1 downgraded, 17 to remove and 0 not upgraded.\n",
   "stdout_lines":[
      "Reading package lists...",
      "Building dependency tree...",
      "Reading state information...",
      "Suggested packages:",
      "  erlang-tools erlang erlang-manpages erlang-doc",
      "Recommended packages:",
      "  erlang-crypto erlang-syntax-tools",
      "The following packages will be REMOVED:",
      "  erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets erlang-mnesia",
      "  erlang-os-mon erlang-parsetools erlang-public-key erlang-runtime-tools",
      "  erlang-snmp erlang-ssl erlang-syntax-tools erlang-tftp erlang-tools",
      "  erlang-xmerl rabbitmq-server",
      "The following packages will be DOWNGRADED:",
      "  erlang-base",
      "0 upgraded, 0 newly installed, 1 downgraded, 17 to remove and 0 not upgraded."
   ]
}

I'm using the current master of this repo.

amanda11 commented 2 years ago

The latest erlang packages are Erlang 25. RabbitMQ 3.10 only has preview support for Erlang 25, so we are recommending the use of Erlang 24 rather than Erlang 25. This is achieved in the playbook by specifying to use erlang 24 as preference over anything else. But if you've upgraded the package in the meantime then you will have upgraded to erlang 25, and so the playbook when run again will go back to erlang 24. We are just updating the apt preferences file so that if you just ask to do a standard apt install, it will prefer 24 over 25. But the preferences file doesn't stop you explicitly upgrading to another version.

Prefered rather than "pinned" might be a better way of explaining it in the playbook.