On 06. april 2017 22:06, Dan F wrote:
I'm thinking of using specific versions for everything whenever I can. This would enable me to mirror exactly what I have in one server to another at any given time.With that said, I tried a very basic install of Apache and attempted to see what it took to get this configured. I started with: tasks: - name: install apache2 apt: name=apache2 state=installed update_cache=yes notify: start apache2 Then, to see the version installed: me@server:~$ apache2 -v Server version: Apache/2.4.18 (Ubuntu) Server built: 2016-07-14T12:32:26 I figure, I should just specify the version in my playbook: tasks: - name: install apache2 apt: name=apache2=2.4.18 state=installed update_cache=yes notify: start apache2
If you run a "apt-cache show apache2 | grep Version" you'll see that the version is longer, something like "2.4.18-2ubuntu3.1"
You'll need to specify the entire string or use wildcard, read more about wildcard in the comments to name here
https://docs.ansible.com/ansible/apt_module.html#options -- Kai Stian Olstad -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/386c3c7f-66d3-087a-34eb-d7d12567ac63%40olstad.com. For more options, visit https://groups.google.com/d/optout.
