Ansible - Install package pinned to major versions
<p>Actual package name in the repo is <code>package-2.6.12-3.el7.x86_64</code>.</p>
<p>The goal is to install a package with Ansible, to:</p>
<ul>
<li>Ensure the point release is installed, such as package-2.6</li>
<li>Doesn't install major releases, such as package-3.0</li>
<li>Updates for minor releases, such as package-2.6.13-4</li>
</ul>
<p>The repo can update packages from time to time, but I don't know when.</p>
<p>My thought was to install a package like this;</p>
<pre class="lang-yaml prettyprint-override"><code>- name: Install package
  yum:
    name: package-2.6
    state: present
</code></pre>
<p>But the task fails, because <code>package-2.6</code> is not in the repo. Whereas simply <code>package</code> works, but it is not future proof.</p>
<hr />
<p>Update:</p>
<p>Seems wildcards <code>*</code> do work, eg <code>package-2.6*</code>. Ensure to quote the wildcard.</p>