i m not able to copy and execute desire script to client node through puppet master.

asked 2016-07-20 03:39:20 -0600

KALPESH gravatar image

TREE OF OUR MODULE************************************

. ├── auth.conf ├── environments │   └── exampleenv │   ├── manifests │   ├── modules │   └── README.environment ├── fileserver.conf ├── manifests │   └── site.pp ├── modules │   └── mymodules │   ├── files │   │   ├── config.sh │   │   ├── con.sh │   │   └── test.txt │   └── manifest │   ├── init.pp │   └── old │   └── init.pp └── puppet.conf

10 directories, 10 files

CLASS FILE WHICH SHOULD COPY CON.SH TO CLIENT NODE************************

[root@puppet mymodules]# cat manifest/init.pp class mymodule::myklass{ file{ '/root/con.sh': ensure => 'file', source => 'puppet:///modules/mymodule/con.sh', path => '/mnt/con.sh', owner => 'root', group => 'root', mode=> '0755', notify => Exec['runmy_script'], }

    exec{
        'run_my_script':
        command => '/mnt/con.sh',
        refreshonly => true,
        }

} include mymodule::myklass [root@puppet mymodules]#

CONTENT OF CON.SH FILE****************************

[root@puppet my_modules]# cat files/con.sh mkdir /root/DD touch test.txt

[root@puppet my_modules]#

after executing below command on client node nothing is happening[root@client mnt]# puppet agent --server puppet --waitforcert 60 --test Info: Retrieving pluginfacts Info: Retrieving plugin Info: Caching catalog for client.acts.com Info: Applying configuration version '1468998010' Notice: Finished catalog run in 0.11 seconds

edit retag flag offensive close merge delete