saltstack-formulas / bareos-formula

A Saltstack formula to install and configure Bareos
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
5 stars 12 forks source link

nested lists support and python3 compatibility #19

Closed Maunty closed 5 years ago

Maunty commented 5 years ago

done :) sorry for typo in commit message :)

Maunty commented 5 years ago

w8 a little bit, i saw in my tests something that i didnt mentioned. This PR adds work with dict nested in list, but nested lists gives not what i expected.

Maunty commented 5 years ago

Nope. Its all right. I was confused because i wanted to recive this kind of config:

FileSet {
    Name = "some_name"
    Include {
        File = "some_dir"
        Options {
            Signature = MD5
        }
    }
    Include {
        Options {
            wilddir = "some_regex"
            wildfile = "some_regex"
        }
        Options {
            Exclude = yes
            RegexFile = "some_regex"
        }
        File = "some_dir"
    }

and problem was in yaml, not im jinja. Valid yaml is :

director:
    config:
      FileSet:
        some_name:               
          Include:
            - Options:
                Signature: MD5
              File: '"some_dir"'
            - Options:
                  - wildfile: '"some_regex"'
                    wilddir: '"some_regex"'
                  - Exclude: 'yes'
                    RegexFile: '"some_regex"'
               File: '"some_dir"'
javierbertoli commented 5 years ago

Thanks, @Maunty !