Ask Your Question
0

Trying to copy a file from a server

asked 2017-04-02 21:23:18 -0500

Sourav gravatar image

Hi there,

I am trying to copy a file from a remote server. The remote server does not have puppet installed.

The file on remote server resides on - /data/share/jp/abc.war

In my SITE.PP, I am trying to mention this so that the agents can copy the file from the remote server.

What would be the way to do it?

Thanks in advance :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-04-03 07:01:05 -0500

puser gravatar image

updated 2017-04-26 06:13:41 -0500

file { 'abc.war':
  ensure => present,
  source => https://server/data/share/jp/abc.war
  mode => '0644',
  owner => 'appdev',
  group  => 'appteam',
}

In your puppet module that is classified to this type of server.

EDIT

Are you running as root? Does the war file have the correct permissions on the web server?

edit flag offensive delete link more

Comments

Thanks, Eric. This looks helpful. Is https protocol necessary? I am not downloading a content from the internet but from a shared server on my domain.

Sourav gravatar imageSourav ( 2017-04-03 23:23:29 -0500 )edit
1

Will this work - file { '/data/share/deploys/abc.war': ensure => present, source => puppet://SYD-LNXD-001/data/dist/abc.war mode => '0644', owner => 'tomcat', group => 'admin', }

Sourav gravatar imageSourav ( 2017-04-03 23:31:39 -0500 )edit

Do I need to define the hostname (SYD-LNXD-001) in the fileserver.conf file?

Sourav gravatar imageSourav ( 2017-04-03 23:44:07 -0500 )edit

that should work, no you do not need https. if you can download the file on your machine from that address then the puppet agent should be able to as well, assuming there are no firewalls in place. You shouldn't need to do anything else.

puser gravatar imagepuser ( 2017-04-05 06:23:38 -0500 )edit

Sorry for my late response. I am getting an error - Error: /Stage[main]/Main/Node[car-lnxd-003.wiley.com]/File[/home/sourav/]: Could not evaluate: Could not retrieve information from environment development source(s) http://car-ABCD-001.abc.com:8080/jenkins/job/Study/ws/dist/study-307.war

Sourav gravatar imageSourav ( 2017-04-21 02:45:17 -0500 )edit

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-04-02 21:23:18 -0500

Seen: 53 times

Last updated: Apr 26