-
Notifications
You must be signed in to change notification settings - Fork 4
Salt 3008 migration #643
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
base: main
Are you sure you want to change the base?
Salt 3008 migration #643
Changes from all commits
e7020ae
21fef3f
da8add9
8dfb6fa
9c5a8b6
c7d9b35
677655d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,26 @@ debconf-utils: | |
| pkg.installed: | ||
| - name: debconf-utils | ||
|
|
||
| # Required for salt-extensions and some python applications. | ||
| pip: | ||
| pkg.installed: | ||
| - pkgs: | ||
| - python3-pip | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Installing pip as part of the core install. It is already on all but two servers, moving to salt-extensions will install it everywhere regardless. |
||
| - build-essential | ||
| - python3-dev | ||
| - install_recommends: False | ||
|
Comment on lines
+26
to
+28
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to review what is required. L28 - install_recommends install build-essential and python3-dev so should be removed from here if we are installing them anyway. |
||
| pip.installed: | ||
| - name: pip | ||
| - upgrade: True | ||
| {% if grains.osmajorrelease|int >= 24 %} | ||
| # https://peps.python.org/pep-0668/ | ||
| - extra_args: | ||
| - --break-system-packages | ||
| - --ignore-installed | ||
| {% endif %} | ||
| - require: | ||
| - pkg: pip | ||
|
|
||
| # Several states add scripts to this directory. | ||
| /home/sysadmin-tools/bin: | ||
| file.directory: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| # Set desired swap size | ||
| {% if grains.mem_total > 32768 %} | ||
| {% set swap_size = [grains.mem_total // 4, 16384] | max %} | ||
| {% elif grains.mem_total > 2048 %} | ||
| {% elif grains.mem_total > 8192 %} | ||
| {% set swap_size = grains.mem_total // 2 %} | ||
| {% else %} | ||
| {% set swap_size = grains.mem_total %} | ||
| {% set swap_size = 4096 %} | ||
| {% endif %} | ||
|
|
||
| {% if salt['pillar.get']('vm:swappiness') %} | ||
| {% set vm_swappiness = pillar.vm.swappiness %} | ||
| {% elif grains.mem_total > 2048 %} | ||
| {% elif grains.mem_total > 4096 %} | ||
| {% set vm_swappiness = 10 %} | ||
| {% else %} | ||
| {% set vm_swappiness = 40 %} | ||
|
|
@@ -17,12 +18,13 @@ | |
| {% set swap_path = '/swapfile' %} | ||
|
|
||
| # Some systems will have swap configured already, if it is sufficient then don't configure more. | ||
| {% if swap_size > grains['swap_total'] %} | ||
| {% set swap_diff = swap_size - grains.swap_total %} | ||
| {% if swap_diff >= 512 %} | ||
| # Create swap file and mount. Only runs if `swap_path` has not been created. | ||
| {{ swap_path }}: | ||
| cmd.run: | ||
| - name: | | ||
| fallocate -l {{ swap_size }}M {{ swap_path }} | ||
| fallocate -l {{ swap_diff }}M {{ swap_path }} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allocating the difference between our desired swap size and the existing swap (such as separate swap partitions). |
||
| chmod 0600 {{ swap_path }} | ||
| mkswap {{ swap_path }} | ||
| - creates: {{ swap_path }} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.