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, 2020 in Ansible by akhtar
• 38,260 points
1,480 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, 2020 by MD
• 95,460 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
3,229 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,987 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 10, 2020 in Ansible by MD
• 95,460 points
4,232 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, 2020 in Ansible by MD
• 95,460 points
1,052 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP