Last active
October 14, 2016 18:29
-
-
Save xphyr/80efc4fa7952c6716e99d4607a447100 to your computer and use it in GitHub Desktop.
Editing a yaml file with cpu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file will handle all the paychex specific edits to openshift config files | |
# # This file updates the following information | |
# # turns on emptydir quotas on compute nodes | |
- hosts: nodes | |
tasks: | |
- name: Update Compute Node EmptyDir quota settings | |
lineinfile: dest=/etc/origin/node/node-config.yaml | |
backup="yes" | |
regexp='^ perFSGroup:' | |
state=present | |
line=" perFSGroup{{ ":" }} 2Gi" | |
register: nodeConfig | |
when: | |
- openshift_node_labels is defined | |
- openshift_node_labels.type == 'compute' | |
- name: Update compute and Infrastructure node system reservations step1 | |
lineinfile: dest=/etc/origin/node/node-config.yaml | |
backup="yes" | |
insertafter='kubeletArguments:' | |
line={{item}} | |
with_items: | |
## this is what is giving me issues | |
## what I want is the 4 lines below added after "kubletArguments:" | |
### kube-reserved: | |
### - "cpu=150m,memory=1G" | |
### system-reserved: | |
### - "cpu=150m,memory=1G" | |
- 'kube-reserved{{ ":" }} "cpu=150m,memory=1G"' | |
- 'system-reserved{{ ":" }} "cpu=150m,memory=1G"' | |
register: nodeConfig |
@m0nkey-br4in thanks, unfortunately we are running v1.9 of ansible, and blockinfile is not available.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe try to use blockinfile like this: