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

Add ansible vars file #2115

Merged
merged 41 commits into from
Sep 20, 2024
Merged

Add ansible vars file #2115

merged 41 commits into from
Sep 20, 2024

Conversation

JimMadge
Copy link
Member

@JimMadge JimMadge commented Aug 9, 2024

✅ Checklist

  • You have given your pull request a meaningful title (e.g. Enable foobar integration rather than 515 foobar).
  • You are targeting the appropriate branch. If you're not certain which one this is, it should be develop.
  • Your branch is up-to-date with the target branch (it probably was when you started, but it may have changed since then).

🚦 Depends on

#2092

⤴️ Summary

Adds an ansible vars file, which is constructed in the infrastructure code and uploaded to the desired state share by Pulumi.
Includes changes from #2103 for release v5.0.0

🌂 Related issues

Closes #2075

🔬 Tests

Tested on a fresh deployment.
All vars and templates as expected and system is working.

@JimMadge JimMadge requested a review from a team as a code owner August 9, 2024 09:11
Copy link

github-actions bot commented Aug 9, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  data_safe_haven/infrastructure/common
  ip_ranges.py
  data_safe_haven/infrastructure/components/composite
  __init__.py
  nfsv3_blob_container.py 22-29, 39-75
  data_safe_haven/infrastructure/components/wrapped
  __init__.py
  nfsv3_storage_account.py 34-35
  data_safe_haven/infrastructure/programs
  declarative_sre.py 342, 367
  data_safe_haven/infrastructure/programs/sre
  data.py 463, 477, 492
  desired_state.py 63-84, 98-220, 224
  networking.py 486, 1561, 1969-1974
  workspaces.py 50
Project Total  

This report was generated by python-coverage-comment-action

@jemrobinson
Copy link
Member

It might be easier to wait until release 5.0.0 is tagged (next week?) and merged back into develop before looking further into this. What do you think @JimMadge ? We could migrate other variables into this file too and close #2075 in the process.

@JimMadge
Copy link
Member Author

JimMadge commented Aug 9, 2024

I don't think this would have to wait for the release, as those changes will be merged back into develop anyway.

In the first instance, I'd want to check that this works before moving all variables from cloud init across.
If it does, we could move all of them in this PR though 👍.

@jemrobinson
Copy link
Member

I think I'd like to see:

  • test that this works on a fresh deployment
  • if it does, see how many other variables can be moved across

I agree there's no explicit problem in merging into develop before we tag v5.0.0 but note that this branch contains some changes that are already in release-v5.0.0 and aren't in develop so it would be cleaner if we could:

  • merge release-v5.0.0 into latest
  • tag release 5.0.0
  • merge latest into develop
  • THEN merge this PR into develop

@JimMadge
Copy link
Member Author

JimMadge commented Aug 9, 2024

I think I'd like to see:

* test that this works on a fresh deployment

* if it does, see how many other variables can be moved across

👍

I agree there's no explicit problem in merging into develop before we tag v5.0.0 but note that this branch contains some changes that are already in release-v5.0.0 and aren't in develop so it would be cleaner if we could:

* merge `release-v5.0.0` into `latest`
* tag release 5.0.0
* merge `latest` into `develop`
* THEN merge this PR into `develop`

I can't see that. They are the same changes end up in develop either way and it won't cause any conflicts.

@jemrobinson
Copy link
Member

Sorry, I meant cleaner in terms of the logic not whether there will be git conflicts (I agree - there won't be). If we merge release-v5.0.0 first then the logic is:

  • this change was made in anticipation of release 5.0.0
  • it was merged back into develop when the release was made
  • then another PR that makes changes on top of that was added to develop

rather than

  • this change was made in anticipation of release 5.0.0
  • it was also separately made in another PR meged into develop

@JimMadge
Copy link
Member Author

Screenshot 2024-08-13 at 09 53 39

The vars file is being templated.

@JimMadge
Copy link
Member Author

Templating works

root@shm-daimyo-sre-hojo-vm-workspace-01:~# ls /etc/skel/Desktop/
gitea.desktop  hedgedoc.desktop  input.desktop  output.desktop  shared.desktop
root@shm-daimyo-sre-hojo-vm-workspace-01:~# cat /etc/skel/Desktop/{gitea,hedgedoc}.desktop
[Desktop Entry]
Version=1.0
Type=Link
Name=Gitea
Comment=
Icon=/usr/local/share/icons/gitea.png
URL=http://gitea.hojo.daimyo.develop.turingsafehaven.ac.uk
[Desktop Entry]
Version=1.0
Type=Link
Name=HedgeDoc
Comment=
Icon=/usr/local/share/icons/hedgedoc.png
URL=http://hedgedoc.hojo.daimyo.develop.turingsafehaven.ac.uk

@JimMadge JimMadge changed the title Add ansible vars file WIP: Add ansible vars file Aug 19, 2024
@JimMadge JimMadge marked this pull request as draft August 19, 2024 09:16
@jemrobinson
Copy link
Member

@JimMadge: worth picking up after RSECon?

@JimMadge JimMadge changed the base branch from develop to mount_points September 17, 2024 08:50
@JimMadge JimMadge changed the title WIP: Add ansible vars file Add ansible vars file Sep 18, 2024
@JimMadge JimMadge marked this pull request as ready for review September 18, 2024 11:30
Copy link
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. A couple of comments though.

@JimMadge JimMadge mentioned this pull request Sep 19, 2024
3 tasks
Base automatically changed from mount_points to develop September 20, 2024 09:12
@JimMadge JimMadge merged commit 7976792 into develop Sep 20, 2024
11 checks passed
@JimMadge JimMadge deleted the ansible_vars_file branch September 20, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud-init variables
2 participants