How to assemble files from a directory?

0 votes

Hi Guys,

I have hosts files in a folder. I want to assemble these files in a single file and then upload it to a remote system using Ansible. How can I do that?

Sep 17 in Ansible by akhtar
• 29,340 points
43 views

1 answer to this question.

0 votes

Hi@akhtar,

Ansible has the assemble module. This module can assemble files from a directory and merged the files in a single file as shown below.

- name: Assemble from fragments from a directory
  assemble:
    src: /etc/someapp/fragments
    dest: /etc/someapp/someapp.conf
answered Sep 17 by MD
• 67,880 points

Related Questions In Ansible

0 votes
1 answer
0 votes
2 answers

How do you stop Ansible from creating .retry files in the home directory?

[defaults] ... retry_files_enabled = True # Create them ...READ MORE

answered Apr 5, 2019 in Ansible by anonymous
1,529 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
740 views
+2 votes
1 answer
0 votes
1 answer

How to create a directory using Ansible?

Hi@akhtar, You can use the file module. To ...READ MORE

answered Aug 9 in Ansible by MD
• 67,880 points
86 views
0 votes
1 answer

How to delete a key pair in AWS from Ansible-Playbook?

Hi@akhtar, You can use the ec2_key module in ...READ MORE

answered Aug 12 in Ansible by MD
• 67,880 points
55 views