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

The error when I run the playbook:

TASK [install apache2] 
*********************************************************
fatal: [192.168.2.33]: FAILED! => {"cache_update_time": 1491508623, 
"cache_updated": true, "changed": false, "failed": true, "msg": 
"'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o 
\"Dpkg::Options::=--force-confold\"     install 'apache2=2.4.18'' failed: 
E: Version '2.4.18' for 'apache2' was not found\n", "stderr": "E: Version 
'2.4.18' for 'apache2' was not found\n", "stdout": "Reading package 
lists...\nBuilding dependency tree...\nReading state information...\n", 
"stdout_lines": ["Reading package lists...", "Building dependency tree...", 
"Reading state information..."]}

-- 
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/7723c818-c1f7-46d5-9d50-cf1e8a4f7463%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to