title: Loading and dumping multiple yaml files with ruamel.yaml (python)
body: <p>Using python 2 (atm) and ruamel.yaml 0.13.14 (RedHat EPEL)</p>
  
  <p>I'm currently writing some code to load yaml definitions, but they are split up in multiple files. The user-editable part contains eg.</p>
  
  <pre><code>users:
    xxxx1:
      timestamp: '2018-10-22 11:38:28.541810'
      &lt;&lt; : *userdefaults
    xxxx2:
      &lt;&lt; : *userdefaults
      timestamp: '2018-10-22 11:38:28.541810'
  </code></pre>
  
  <p>the defaults are stored in another file, which is not editable:</p>
  
  <pre><code>userdefaults: &amp;userdefaults
      # Default values for user settings
      fileCountQuota: 1000
      diskSizeQuota: "300g"
  </code></pre>
  
  <p>I can process these together by loading both and concatinating the strings, and then running them through <code>merged_data = list(yaml.load_all("{}\n{}".format(defaults_data, user_data), Loader=yaml.RoundTripLoader))</code> which correctly resolves everything. (when not using RoundTripLoader I get errors that the references cannot be resolved, which is normal) </p>
  
  <p>Now, I want to do some updates via python code (eg. update the timestamp), and for that I need to just write back the user part. And that's where things get hairy. I sofar haven't found a way to just write that yaml document, not both.</p>