# Confusion about storing and accessing variables

**URL:** <https://forum.ansible.com/t/confusion-about-storing-and-accessing-variables/29194>\
**Category:** Ansible Project\
**Created:** [December 4, 2018, 5:44pm UTC](https://forum.ansible.com/t/confusion-about-storing-and-accessing-variables/29194 "2018-12-04T17:44:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Hickok](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Matt\_Hickok](https://forum.ansible.com/u/Matt_Hickok)\
**Post date:** [December 4, 2018, 5:44pm UTC](https://forum.ansible.com/t/confusion-about-storing-and-accessing-variables/29194/1 "2018-12-04T17:44:18Z")

</div>

Hello, I’m trying to store a cisco device config in the fact cache, I’m doing it like this:

- name: “Get Config”  
register: config  
ios\_command:  
commands: show running-config

- name: “Store config as fact”  
set\_fact:  
config: “{{ config.stdout }}”  
cacheable: true

While it’s working, the resulting fact being created is the entire output from ios\_command, meaning it includes changed, failed, stdout, and stdout\_lines.

I thought I was created a variable with “register: config” and then was storing just the stdout part of the variable by doing: config: “{{ config.stdout }}”

Is that not the proper way of accessing a variable?
