Forum: CFEngine Help
Subject: Re: Divide Repository
Author: obris
Link to topic: https://cfengine.com/forum/read.php?3,24964,24966#msg-24966

Hi Rob,

For your first question, i would say that's up to you to organise your 
repository the way you like. To take your exemple, this could be an exemple:


    .
    ├── all
    │   └── fileA.txt
    │    └──i386
    │    └──x86_64
    ├── rhel
    │   ├── i386
    │   │   └── fileB.txt
    │   └── x86_64
    │       └── fileC.txt
    └── sles
        ├── i386
        │   └── fileD.txt
        └── x86_64
            └── fileE.txt


Please note that i also created a repository "all" to copy files which are not 
OS specific. But again, it's up to you to see if you really need it.

To use this in your policy, here is a very little exemple on how you could use 
it:


#############################################################################
bundle agent update
        {
        
        files:
        
                redhat.32_bit::
                "/tmp/fileB.txt"
                copy_from => 
remote_cp("/var/cfengine/masterfiles/rhel/i386/fileB.txt", "10.146.19.26");

                redhat.64_bit::
                "/tmp/fileC.txt"
                copy_from => 
remote_cp("/var/cfengine/masterfiles/rhel/x86_64/fileC.txt", "10.146.19.26");

                linux::
                "/tmp/fileA.txt"
                copy_from => 
remote_cp("/var/cfengine/masterfiles/all/fileA.txt", "10.146.19.26");

                
reports:
              redhat.64_bit::
              "File copied!";
}
#############################################################################


The adresse "10.146.19.26" is my repository: you'll have to change this.

The name of the classes ("redhat.64_bit" for exemple) can be acquired with this 
command: cf-promises -v 
You can find more about this topic here: 
https://cfengine.com/manuals/cf3-reference#Hard-classes

Kind Regards

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to