Ask Your Question
0

Need help with archiving a directory "/users", unmounting it and then commenting the fstab file

asked 2017-07-14 05:01:08 -0500

monalsharma gravatar image

I'm looking for some help around this task:

a) cd /
b) run #tar -cvf users.tar users
c) #umount -l /users
d) #mv /users /OLDusers
e) comment in fstab #/dev/redhat/users
lv    /users  ext4    defaults,nodev  1       2

So basically, I need to archive a directory, unmount it and then comment it from the /etc/fstab file.

Commenting the fstab, I think can be done via augeas. Could you please help me with the archiving section.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2017-07-17 00:29:40 -0500

monalsharma gravatar image

Thanks DarylW. We only use Puppet for Configuration Management and the current ask is to automate a list of steps we perform after a host is provisioned.

I'm basically looking for a method in puppet which can help me archive a directory. I don't want to use "exec" to run these commands for various reasons. Hence the ask.

Thanks for your response though.

edit flag offensive delete link more

Comments

If is is on a fresh provision, why do you need to archive them? Either way, you are basically limited to a one time script that would do the steps you need in an exec (with appropriate onlyif/creates params)

DarylW gravatar imageDarylW ( 2017-07-17 05:45:47 -0500 )edit
0

answered 2017-07-14 08:09:28 -0500

DarylW gravatar image

This isn't a task that you would do with puppet. Puppet is about describing the existing state of the system that you want, not a series of steps to perform some task across the systems.

There are a few tools that can help with performing 'tasks' across your infrastructure. fabric, Ansible, MCollective(made eaiser with the current plugins from http://choria.io/), etc.

With those tools, you can define a playbook/runbook/set of instructions that you will execute on all of the machines (the archiving task), and then you can use puppet to ensure the fstab changes are set to the configuration that you require.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-07-14 05:01:08 -0500

Seen: 41 times

Last updated: Jul 17