saltstack-formulas / lxd-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
21 stars 18 forks source link

refactor(pip): loosen pip logic & updated pillar example #18

Closed noelmcloughlin closed 4 years ago

noelmcloughlin commented 4 years ago

This PR is an improvement for first time users of lxd.

If use_pip or use_pip_formula are set then some errors can happen-

  1. Error SLS pip / pip.extensions not found - there is hard dependency on pip-formula.
  2. Error State 'lxd.init' was not found in SLS 'lxd.lxd' because
    • pylxd pip package is not installed
    • pylxd pip package was installed by wrong pip binary
    • combination of these

And it's not easy to setup default profile

a. Errors LXDAPIException: Common start logic: ...... because new users are dumb ;=) b. Usingnictype: macvlan worked best for during basic testing.

This PR was verified on Ubuntu 18.04 with updated pillar.example. All states passed finally.

noelmcloughlin commented 4 years ago

Note: On fresh installed ubuntu the 1st execution cannot find pylxd in modules.
Works fine on subsequent runs so this is corner case.

              python3-pip:
                  ----------
                  new:
                      9.0.1-2.3~ubuntu1.18.04.1
                  old:
              python3-secretstorage:
                  ----------
                  new:
                      2.3.1-2
                  old:
              python3-setuptools:
                  ----------
                  new:
                      39.0.1-2
                  old:
              python3-wheel:
                  ----------
                  new:
                      0.30.0-0.2
                  old:
              python3-xdg:
                  ----------
                  new:
                      0.25-4ubuntu1
                  old:
              python3.6:
                  ----------
                  new:
                      3.6.8-1~18.04.1
                  old:
                      3.6.7-1~18.04
              python3.6-dev:
                  ----------
                  new:
                      3.6.8-1~18.04.1
                  old:
              python3.6-minimal:
                  ----------
                  new:
                      3.6.8-1~18.04.1
                  old:
                      3.6.7-1~18.04
----------
          ID: lxd_python
    Function: pip.installed
        Name: pylxd
      Result: True
     Comment: All packages were successfully installed
     Started: 05:52:12.016191
    Duration: 29610.752 ms
     Changes:   
              ----------
              pylxd==2.2.10:
                  Installed
----------
          ID: lxd_lxd
    Function: pkg.installed
      Result: True
     Comment: The following packages were installed/updated: criu
              The following packages were already installed: lxd
     Started: 05:52:41.633700
    Duration: 12524.518 ms
     Changes:   
              ----------
              criu:
                  ----------
                  new:
                      3.6-2
                  old:
              libnet1:
                  ----------
                  new:
                      1.1.6+dfsg-3.1
                  old:
              libprotobuf-c1:
                  ----------
                  new:
                      1.2.1-2
                  old:
              libprotobuf10:
                  ----------
                  new:
                      3.0.0-9.1ubuntu1
                  old:
              python-ipaddr:
                  ----------
                  new:
                      2.2.0-1
                  old:
              python-protobuf:
                  ----------
                  new:
                      3.0.0-9.1ubuntu1
                  old:
----------
          ID: lxd_lxd
    Function: lxd.init
      Result: False
     Comment: State 'lxd.init' was not found in SLS 'lxd.lxd'
              Reason: 'lxd' __virtual__ returned False
     Changes:
jochumdev commented 4 years ago

Nice Thank you!