How do i use search to find chef nodes based on a criteria?



  • knife search man page: http://bit.ly/2pAchAn

    This search find nodes based on platform type.

    $ knife search node platform:ubuntu
    1 items found
    
    Node Name:   sector12
    Environment: _default
    FQDN:        sector12
    IP:          10.50.20.5
    Run List:    recipe[cowsay]
    Roles:       
    Recipes:     cowsay, cowsay::default
    Platform:    ubuntu 16.10
    Tags:        
    

    You can search through data bags and make use of wildcard matching. This finds a variable root, with any value.

    $ knife search passwords 'root:*'
    1 items found
    
    chef_type: data_bag_item
    data_bag:  passwords
    id:        mysql
    root:
      cipher:         aes-256-cbc
      encrypted_data: nOgjF4QzK0PqetaYnbf97R9kkHrm3RL1B9i1VE1M5cA=
      
      iv:             DNJ1xzptNOPtd0YFZNgWPw==
      
      version:        1
    

Log in to reply
 

© Lightnetics 2024