This issue can be fixed with below changes in File: $puppet/modules/cobbler/manifests/ubuntu.pp
Design:
1. If "-auto" profile object does not exist:
1. Check if default profile object exists else create default profile object.
2. Use this as parent and create a profile using "$cobbler profile add" command.
2. If profile does not exist:
1. Check if distro exist else create a distro object
2. Create profile using "$cobbler profile add" command.
3. If the distro does not exist:
1. Create distro object using "$cobbler-ubuntu-import" command.
Adding two new exec blocks for re-creating the profiles if they does not exists.
This issue can be fixed with below changes in File: $puppet/ modules/ cobbler/ manifests/ ubuntu. pp ubuntu- import" command.
Design:
1. If "-auto" profile object does not exist:
1. Check if default profile object exists else create default profile object.
2. Use this as parent and create a profile using "$cobbler profile add" command.
2. If profile does not exist:
1. Check if distro exist else create a distro object
2. Create profile using "$cobbler profile add" command.
3. If the distro does not exist:
1. Create distro object using "$cobbler-
Adding two new exec blocks for re-creating the profiles if they does not exists.
exec {"cobbler- profile- add-${name} -${arch} ": import- $name-$ arch"],
command => "cobbler profile add --name ${name}-${arch} --distro ${name}-${arch}",
path => "/usr/bin:/bin",
provider => shell,
unless => "cobbler profile list | grep precise-x86_64",
onlyif => "test -n `cobbler distro list |grep precise-x86_64`",
require => Exec["cobbler-
}
exec {"cobbler- profile- add-${name} -${arch} -auto": -${arch} -auto --parent ${name}-${arch}", x86_64- auto", profile- add-${name} -${arch} "],
command => "cobbler profile add --name ${name}
path => "/usr/bin:/bin",
provider => shell,
unless => "cobbler profile list | grep precise-
onlyif => "test -n `cobbler profile list |grep precise-x86_64`",
require => Exec["cobbler-
}
#Anchor these Exec resource while creating profiles. profile- ${name} -${arch} ": profile- add-${name} -${arch} "], profile- ${name} -${arch} -auto": profile- add-${name} -${arch} -auto"] ,
anchor{ "cobbler-
require => Exec["cobbler-
}
anchor { "cobbler-
require => Exec["cobbler-
}