dayglojesus / managedmac

Comprehensive Puppet module for OS X.
http://dayglojesus.github.io/managedmac/
Apache License 2.0
62 stars 21 forks source link

hiera remove profile #87

Closed clburlison closed 9 years ago

clburlison commented 9 years ago

Is it possible to remove a profile that has been installed with hiera using hiera?

Install example:

managedmac::mobileconfigs::payloads:
  'com.apple.Safari':
    displayname: 'Safari Settings'
    content:
    - PayloadContent:
        com.apple.Safari:
          Forced:
          - mcx_preference_settings:
              HomePage: 'http://www.birdvilleschools.net'
              NewWindowBehavior: '0'
      PayloadType: com.apple.ManagedClient.preferences

Remove example:

managedmac::mobileconfigs::payloads:
  'com.apple.Safari':
    ensure: absent

The following makes me think it is possible mobileconfig.rb#L47-L50 but I'm not getting it to work. Am I missing something?

dayglojesus commented 9 years ago

Everybody's favourite answer: "It works for me..." 😋

I just cut & pasted that code into my config and it added and subsequently removed it.

Can you try this...?

sudo puppet resource mobileconfig com.apple.Safari ensure=absent

That should definitely work (Hiera or not) and the principle is the same.

clburlison commented 9 years ago

Thanks Brian! The above also works for me. I just had to stop making changes to production and verifying on a machine set to testing. Easy to get lost in hiera.