Created
          March 23, 2015 13:15 
        
      - 
      
- 
        Save Seegras/59b05a3dc47b6344cb17 to your computer and use it in GitHub Desktop. 
    Creates a hiera yaml file for use with puppet-icinga2 from icinga1 host objects
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | for i in *.cfg; do egrep 'host_name|address' $i | sed 's/host_name/display_name:/' | sed 's/address/ipv4_address:/' | sed -s 's/\t/ /g' | sed -s 's/\s/ /g' | tr "\n" " " | awk '{ print " '\''"$2"'\'':\n " $1 " '\''" $2 "'\''\n " $3 "'\''" $4 "'\''\n groups:\n - '\''linux'\''\n - '\''wualaserver'\''\n target_file_name: '\''"$2".conf'\''" }' ; done | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment