>
> Hi Nirav and thanks for the reply.
>>>
>>
Sorry, i wasn't clear.  i am interested in your role setup with Packer. 

Do roles work exactly the same as if i was just applying to a running 
server?  Did you have to do anything different or factor any changes in 
files or directory layout?

My goal is to have a role that can be run on any server, be that a running 
instance or with packer AMI image. I only want to maintain the compliance 
role in one repo with all the rest of our ansible code.  I am just not sure 
if this will work with Packer and that there will be subtle differences. 
 Eg, host will be all, 

I'm looking to something like:

.
├── ansible.cfg
├── environment
│   └── packerbuild
│       ├── group_vars
│       │─  hosts
│       └── host_vars
│           └── 
│   └── dev
│       ├── group_vars
│       │    
│       ├── hosts
│       └── host_vars
│           
├── hostkeys
│   └── hostkey1
├── playbooks
│   ├── build.yml
├── roles
│   │   
│   └── compliance
│       ├── defaults
│       │   └── main.yml
│       ├── files
│       │   └── file1.sh
│       ├── handlers
│       │   └── main.yml
│       ├── meta
│       │   └── main.yml
│       ├── README.md
│       ├── tasks
│       │   ├── task1.yml
|       |   |- main.yml
│       │   │       │   
│       │   └── test.yml
│       ├── templates
│       │   ├── template1.j2.
│       │ 
│       ├── tests
│       │   ├── inventory
│       │   └── test.yml
│       └── vars
│           └── main.yml


I have a build playbook under ansible/playbooks which calls the compliance 
role.  This role has multiple include statements in the role/tasks/mainyml
This works fine to apply to a running server from my control node but  it 
seems that the playbook calling the role cant be in ansible/playbooks but 
must be relative to the role so i had to move this one level up.

cat packer-role/build.yml
---

- name:  Build Role
  hosts: all
  roles:
    - role: compliance



Would you mind sharing any guidance you have with using roles and 
ansible-remote provisioner?   
Do you have a separate ansible code base for packer?

Cheers

Mat



-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/fa58c8dd-06f7-4faa-8938-a825817ffe87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to