[chef] etckeeper cookbook


Chronological Thread 
  • From: Mohammad Fattahian < >
  • To:
  • Subject: [chef] etckeeper cookbook
  • Date: Tue, 2 Jun 2015 11:34:54 -0400

We have an issue with etckeeper on Ubuntu 14.04

 

When you install etckeepet, by default it’s configured to use “bzr” for version control. On 12.04 when you change the etckeeper.conf to use “git” you can initialize the repository and everything works fine.

 

On 14.04 (new version of etckeeper) you have to uninit the repository, created by bzr, and re-init again to use git.

 

How can I implement it on my recipe?

 

Here is part of etckeeper::config :

 

 

bash "init_repo" do

  user "root"

  cwd "/etc"

  if node['etckeeper']['git_remote_enabled']

    git_remote = <<-EOF

      git remote add origin #{node['etckeeper']['git_host']}:#{node['etckeeper']['git_repo']}

      git checkout -b #{node['etckeeper']['git_branch']}

      git push origin #{node['etckeeper']['git_branch']}

    EOF

  else

    git_remote = nil

  end

  code <<-EOH

  etckeeper init

  etckeeper commit \"Initial commit\"

  #{git_remote}

  #{node['etckeeper']['dir']}/cron_task

  EOH

  not_if do

    File.directory?("/etc/.git")

  end

end



  • [chef] etckeeper cookbook, Mohammad Fattahian, 06/02/2015

Archive powered by MHonArc 2.6.16.

§