Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tofs): use source_files instead of files #76

Merged

Conversation

myii
Copy link
Member

@myii myii commented Mar 9, 2019


Once agreed upon, changes need to propagated based on recent TOFS updates in other formulas:

Please add a comment if I have missed anywhere else.


Have tested this with a modified template/config.file.sls, introducing multiple uses of the files_switch macro. Confirmed that I got the same results before and after these changes:

template-config-file-file-managed:
  file.managed:
    - name: /etc/template.d/custom-ubuntu.conf
    - source:
      - salt://template/files/ABC/example_alt.tmpl
      - salt://template/files/Debian/example_alt.tmpl
      - salt://template/files/default/example_alt.tmpl
    - mode: 644
    - user: root
    - group: root
    - template: jinja

formula.autofs.config.master:
  file.managed:
    - name: /root/auto.master
    - source:
      - salt://template/files/ABC/auto.master
      - salt://template/files/Debian/auto.master
      - salt://template/files/default/auto.master
    - mode: 644
    - user: root
    - group: root
    - template: jinja

formula.autofs.config.home:
  file.managed:
    - name: /root/auto.homeLdap
    - source:
      - salt://template/files/ABC/auto.homeLdap
      - salt://template/files/Debian/auto.homeLdap
      - salt://template/files/default/auto.homeLdap
    - mode: 644
    - user: root
    - group: root
    - template: jinja

formula.autofs.config.away:
  file.managed:
    - name: /root/auto.awayLdap
    - source:
      - salt://template/files/ABC/auto.awayLdap
      - salt://template/files/Debian/auto.awayLdap
      - salt://template/files/default/auto.awayLdap
    - mode: 644
    - user: root
    - group: root
    - template: jinja

@myii myii requested a review from aboe76 March 9, 2019 06:47
@daks
Copy link
Member

daks commented Mar 9, 2019

Looks good to me.

As you tested the change manually, I wonder if it could be added to inspec. The test setup must be somewhat complex (need to push files to files_roots, etc.) even if possible.

@myii
Copy link
Member Author

myii commented Mar 9, 2019

@daks That would be ideal. I've added that to the list in #21 for the time being.

@aboe76 Can we get the merge, so that I can submit the PRs to the other repos as well?

@myii
Copy link
Member Author

myii commented Mar 9, 2019

@aboe76 @daks Is there a way of getting the state ID from within the state itself? If so, this solution could be improved further. Assuming it was state_id, I'd like to replace:

tplroot ~ ':tofs:source_files:template-config-file-file-managed',

With:

tplroot ~ ':tofs:source_files:' ~ state_id,

@aboe76
Copy link
Member

aboe76 commented Mar 9, 2019

@myii not that I know off, shall I merge it?

@myii
Copy link
Member Author

myii commented Mar 9, 2019

@aboe76 Yes, if there's nothing else required from your end.

@aboe76 aboe76 merged commit f72c621 into saltstack-formulas:master Mar 9, 2019
@aboe76
Copy link
Member

aboe76 commented Mar 9, 2019

@myii merged

@myii myii deleted the bug/remove-dupe-files-in-tofs branch March 9, 2019 22:16
@myii
Copy link
Member Author

myii commented Mar 9, 2019

@aboe76 Thanks. I'll push the other PRs soon.

@aboe76
Copy link
Member

aboe76 commented Mar 9, 2019

nice, ping me

@saltstack-formulas-travis

🎉 This PR is included in version 1.2.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants