G: Use an other way to synchronize/test promises from dev machine to cfengine3 client

  • On the cfengine3 client test :

- add unix group cfengine (groupadd cfengine) - Allow members of group cfengine to checkout inputs in /etc/sudoers file (visudo)

%cfengine  ALL=(root) NOPASSWD: /usr/bin/git --work-tree=/var/cfengine/inputs checkout -f

- With a member of group cfengine init the cf-inputs git repository

mkdir cf-inputs
cd cf-inputs
git init --bare

- Edit hooks/post-receive

sudo /usr/bin/git --work-tree=/var/cfengine/inputs checkout -f
echo Updated Successfully
  • On the dev

- Clone the repository

git clone <user_member_of_cfengine_group>@<ip_cfengine3_client>:./cf-inputs

- Add/Edit cfengine3 files - Commit and Push

git add -A
git commit -m'first import'
git push origin master

Enjoy !