<commit_before>* yum
** yum_repos_d
Manage yum repository client configuration files residing in
`/etc/yum.repos.d/*.repo`.

This bundle looks in data_interface_bundle for a variable named
'data'. This variable needs to be either a datacontainer or a classic
cfengine array. It expects to find a key named for itself
'yum_repos_d'and under that key a key for each repository to be
configured. This allows for very flexible data construction, and other
keys will be ignored. This bunlde will reconstruct the data under its
key locally into a classic array. This is done to support expansion of
cfengine variables within a data container.

- @param extra_repo_files_state Defines weather to keep or purge
  unspecified repo files. (purge|keep) Defaults to keep.
- @param data_interface_bundle The bundle in which to look for 'data'

Enabled by setting the class `enable_yum_repos_d`

*** Example Usage
#+begin_src cfengine
  bundle agent example_usage
  {
    methods:
      production::
        "repos" usebundle => yum_repos_d("purge", "yum_repos_d_data_bundle_pure_policy_example");
      development::
        "repos" usebundle => yum_repos_d("keep", " yum_repos_d_data_bundle_readjson_example");
  }
  
  # Example data interface bundles
  bundle agent yum_repos_d_data_bundle_pure_policy_example
  {
    vars:
      "data[yum_repos_d][updates][name]" string => "CentOS Updates";
      "data[yum_repos_d][updates][baseurl]" string => "http://my.yum/repo";
      "data[yum_repos_d][updates][enable]" string => "1";
      "data[yum_repos_d][updates][gpgcheck]" string => "0";
      "data[yum_repos_d][updates][gpgkey]" string => "http://mirror.cisp.com/CentOS/6/os/i386/RPM-GPG-KEY-CentOS-6";
      "data[yum_repos_d][updates][proxy]" string => "FUCKIt";
  }
  
  bundle agent yum_repos_d_data_bundle_parsejson_example
  {
    vars:
      "data" data => parsejson('
  {
    "yum_repos_d" {
  
    "updates": {
      "name": "CentOS Updates",
      "baseurl": "http://$(locations.rpm_repo)/repo",
      "enable": "1",
      "gpgcheck": "0",
      "gpgkey": "http://mirror.cisp.com/CentOS/6/os/i386/RPM-GPG-KEY-CentOS-6"
    }
  }
  }');
  }
  
  bundle agent yum_repos_d_data_bundle_readjson_example
  {
    vars:
      "data_file" string => "$(this.promise_diranme)../data/$(this.bundle).json";
        
      "data" data => readjson( $(data_file), 1M );
        
    classes:
      "data_file_exists" expression => fileexists( $(data_file) );
  }
#+end_src

** yum_inventory
Inventory information about yum

All inventory information is cached. If you would like to invalidate the cache you may do so using the following classes:

- yum_info_yum_cache_invalid
- yum_repolist_disabled_cache_invalid
- yum_repollist_enabled_cache_invalid

Enabled by setting the class `enable_yum_inventory`

Ensure the policy is activated

#+begin_src cfengine
  methods:
    !redhat_4.(redhat|centos)::
      "yum" usebundle => yum_inventory;
#+end_src

*** yum_inventory_yum_info_yum
Inventory interesting information about yum. Currently this includes
the yum plugins (if any) which are loaded.

Variables for enabled plugins are defined and tagged for use in
CFEngine Enteprise Mission Portals Inventory interface. Classes are
defined for each loaded plugin in the form
`yum_plugin_<plugin_name>_loaded`.

*** yum_inventory_yum_repolist
Inventory interesting information about the yum repositories configured.

Variables for each enabled and disabled repository are defined and
tagged for use in CFEngine Enterprise Mission Poratls Inventory
interface. Classes are defined for each configured repo in the form
`yum_repo_<repo_id>_enabled` or `yum_repo_<repo_id>_disabled`.
<commit_msg>Add: Images to README<commit_after>* yum
** yum_repos_d
Manage yum repository client configuration files residing in
`/etc/yum.repos.d/*.repo`.

This bundle looks in data_interface_bundle for a variable named
'data'. This variable needs to be either a datacontainer or a classic
cfengine array. It expects to find a key named for itself
'yum_repos_d'and under that key a key for each repository to be
configured. This allows for very flexible data construction, and other
keys will be ignored. This bunlde will reconstruct the data under its
key locally into a classic array. This is done to support expansion of
cfengine variables within a data container.

- @param extra_repo_files_state Defines weather to keep or purge
  unspecified repo files. (purge|keep) Defaults to keep.
- @param data_interface_bundle The bundle in which to look for 'data'

Enabled by setting the class `enable_yum_repos_d`

*** Example Usage
#+begin_src cfengine
  bundle agent example_usage
  {
    methods:
      production::
        "repos" usebundle => yum_repos_d("purge", "yum_repos_d_data_bundle_pure_policy_example");
      development::
        "repos" usebundle => yum_repos_d("keep", " yum_repos_d_data_bundle_readjson_example");
  }
  
  # Example data interface bundles
  bundle agent yum_repos_d_data_bundle_pure_policy_example
  {
    vars:
      "data[yum_repos_d][updates][name]" string => "CentOS Updates";
      "data[yum_repos_d][updates][baseurl]" string => "http://my.yum/repo";
      "data[yum_repos_d][updates][enable]" string => "1";
      "data[yum_repos_d][updates][gpgcheck]" string => "0";
      "data[yum_repos_d][updates][gpgkey]" string => "http://mirror.cisp.com/CentOS/6/os/i386/RPM-GPG-KEY-CentOS-6";
      "data[yum_repos_d][updates][proxy]" string => "FUCKIt";
  }
  
  bundle agent yum_repos_d_data_bundle_parsejson_example
  {
    vars:
      "data" data => parsejson('
  {
    "yum_repos_d" {
  
    "updates": {
      "name": "CentOS Updates",
      "baseurl": "http://$(locations.rpm_repo)/repo",
      "enable": "1",
      "gpgcheck": "0",
      "gpgkey": "http://mirror.cisp.com/CentOS/6/os/i386/RPM-GPG-KEY-CentOS-6"
    }
  }
  }');
  }
  
  bundle agent yum_repos_d_data_bundle_readjson_example
  {
    vars:
      "data_file" string => "$(this.promise_diranme)../data/$(this.bundle).json";
        
      "data" data => readjson( $(data_file), 1M );
        
    classes:
      "data_file_exists" expression => fileexists( $(data_file) );
  }
#+end_src

** yum_inventory
Inventory information about yum

All inventory information is cached. If you would like to invalidate the cache you may do so using the following classes:

- yum_info_yum_cache_invalid
- yum_repolist_disabled_cache_invalid
- yum_repollist_enabled_cache_invalid

Enabled by setting the class `enable_yum_inventory`

Ensure the policy is activated

#+begin_src cfengine
  methods:
    !redhat_4.(redhat|centos)::
      "yum" usebundle => yum_inventory;
#+end_src

#+caption: Mission Portal Invetory Report Additional Attributes
[[../images/2015-01-30-Selection_001.jpg]]
#+caption: Mission Portal Inventory Report Yum Plugins Loaded & Enabled Repositories
[[../images/2015-01-30-Selection_002.jpg]]
[[../images/2015-01-30-Selection_003.jpg]]

*** yum_inventory_yum_info_yum
Inventory interesting information about yum. Currently this includes
the yum plugins (if any) which are loaded.

Variables for enabled plugins are defined and tagged for use in
CFEngine Enteprise Mission Portals Inventory interface. Classes are
defined for each loaded plugin in the form
`yum_plugin_<plugin_name>_loaded`.

*** yum_inventory_yum_repolist
Inventory interesting information about the yum repositories configured.

Variables for each enabled and disabled repository are defined and
tagged for use in CFEngine Enterprise Mission Poratls Inventory
interface. Classes are defined for each configured repo in the form
`yum_repo_<repo_id>_enabled` or `yum_repo_<repo_id>_disabled`.

{'fraction_non_alphanumeric': 0.09773352548146207, 'fraction_numerical': 0.008515655705489322, 'mean_word_length': 4.294036061026352, 'pattern_counts': {'":': 12, '<': 9, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5156829', 'n_tokens_mistral': 2595, 'n_tokens_neox': 2462, 'n_words': 713}