Hi,

I am unable to get NFS configured correctly on EC2 instances launched via 
the 'ec2' module in Ansible. When I launch instances using the exact same 
AMI from the AWS EC2 console, NFS works without a hitch.

First I'll describe my setup, and then how to reproduce the problem. I'm 
running Ansible from a Mac OSX Yosemite version 10.10.3.

    $ ansible --version
        ansible 1.9.2

I was also able to reproduce the problem from a machine running Debian 8.1 
with Ansible version 1.9.

This is the ansible playbook I'm using to launch 2 ec2 instances.

    $ cat test-nfs.yml
        - hosts: localhost
          tasks:
           - ec2:
              key_name: my_key
              aws_region: us-east-1
              zone: us-east-1c
              image: ami-d05e75b8
              vpc_subnet_id: subnet-cba9efbc
              instance_type: t2.micro
              exact_count: 2
              count_tag:
                Name: nfs-test
              instance_tags:
                Name: nfs-test
              assign_public_ip: yes
              wait: yes

Launch two instances.

    <command machine>$ ansible-playbook -i ./ec2.py test-nfs.yml

Then, SSH into the first instance and set up NFS.

    <command machine>$ ssh ubuntu@<nfs-server ip>
    <nfs-server>$ sudo mkdir -m 777 /test
    <nfs-server>$ sudo apt-get install nfs-kernel-server
    <nfs-server>$ sudo cat "/test    *(rw,async,no_subtree_check)" >> 
/etc/exports
    <nfs-server>$ sudo service nfs-kernel-server restart

Attempt to mount NFS on the second instance.

    <nfs-client>$ sudo mkdir -m 777 /test
    <nfs-client>$ sudo apt-get install nfs-common
    <nfs-client>$ sudo mount <nfs-server ip>:/test /test

The last step (mounting /test) hangs and times out if the instances were 
launched using the ansible ec2 module, but completes almost instantly when 
the instance are launched from the AWS EC2 console or using the AWS CLI.

    $ aws ec2 run-instances --image-id ami-d05e75b8 --count 1 
--instance-type t2.micro --key-name test --security-group-ids sg-8fd0f7eb 
--subnet-id subnet-cba9efbc

Any help would be greatly appreciated. I can provide additional information 
about the setup if requested.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/545872d9-4afd-4840-b0d4-b19a284ecdf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to