1844070 Members
3052 Online
110227 Solutions
New Discussion

Help with rdist. Please!

 
SOLVED
Go to solution
Alex Richardson
Advisor

Help with rdist. Please!

Hello,

I am trying to setup rdist, but I seem to be stuck distributing exactly the same file from one server to another. I would like to have different files for (/etc/passwd, /etc/hosts, etc..) for different enviornments. I have setup a very simple distfile to copy some files, but how would you for example setup...

HOSTS.DEV = (foo, bar)
HOSTS.PROD = (rab, oof)

FILES.DEV = (/etc/passwd.dev, /etc/hosts.dev)
FILES.PROD = (/etc/passwd.prod, /etc/hosts.prod)

${FILES.DEV} -> ${HOSTS.DEV}

${FILES.PROD} -> ${HOSTS.PROD}

Now I want these files copied, but named with the standard naming convention. (not /etc/passwd.dev, etc.) Does anyone know how to set this up??

Thanks
1 REPLY 1
Tim Malnati
Honored Contributor
Solution

Re: Help with rdist. Please!

Name changes or redirected directories need to take place on the install line. The way this was setup would require individual install sequences for each file where name change wildcards are not allowed. First thing, rdist is not happy about commas, it needs standard whitspace (space, tab, newline) instead and whitespace between the variables/literals and the parenthesis grouping characters (). To simplify it I suggest you create a director for the files on the source and redirect the directory instead. In this case I made it /etc/dist with subdirectories dev and prod under that; see below:

HOSTS.DEV = ( foo bar )
HOSTS.PROD = ( rab oof )

FILES.DEV = ( /etc/dist/dev/passwd /etc/dist/dev/hosts )
FILES.PROD = ( /etc/dist/prod/passwd /etc/dist/prod/hosts )

${FILES.DEV} -> ${HOSTS.DEV}
install /etc ;

${FILES.PROD} -> ${HOSTS.PROD}
install /etc ;