Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Commits
9dc1444c
Commit
9dc1444c
authored
8 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
better filters to only execute shell commands when necessary
parent
4953330a
No related branches found
No related tags found
1 merge request
!118
Ansible check
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/etcHosts/tasks/main.yml
+17
-1
17 additions, 1 deletion
roles/etcHosts/tasks/main.yml
with
17 additions
and
1 deletion
roles/etcHosts/tasks/main.yml
+
17
−
1
View file @
9dc1444c
...
...
@@ -2,18 +2,34 @@
copy
:
src=files/etcHosts dest=/etc/hosts owner=root mode=644
sudo
:
true
-
name
:
get hostname by sysctl
shell
:
sysctl kernel.hostname | cut -f 3 -d " "
register
:
sysctl_hostname
check_mode
:
no
become
:
true
become_user
:
root
-
name
:
set hostname by sysctl
shell
:
sysctl kernel.hostname="{{ inventory_hostname }}"
sudo
:
true
when
:
not "{{ sysctl_hostname.stdout }}" == "{{ inventory_hostname }}"
-
name
:
get domainname by sysctl
shell
:
sysctl kernel.domainname | cut -f 3 -d " "
register
:
sysctl_domainname
check_mode
:
no
become
:
true
become_user
:
root
-
name
:
set domainname by sysctl
shell
:
sysctl kernel.domainname="{{ domain }}"
sudo
:
true
when
:
not "{{ sysctl_domainname.stdout }}" == "{{ domain }}"
-
name
:
set /etc/sysconfig/network on CentOS
6
lineinfile
:
dest=/etc/sysconfig/network line='HOSTNAME={{ inventory_hostname }}' regexp='^HOSTNAME'
sudo
:
true
when
:
ansible_distribution == "CentOS"
when
:
ansible_distribution == "CentOS"
and ansible_distribution_major_version == "6"
-
name
:
set /etc/sysctl.conf on Debian
8
lineinfile
:
dest=/etc/sysctl.conf line='kernel.domainname = {{ domain }}' regexp='^#kernel.domainname'
...
...
This diff is collapsed.
Click to expand it.
Chris Hines
@chines
mentioned in commit
b580ddb9
·
4 years ago
mentioned in commit
b580ddb9
mentioned in commit b580ddb98279d3daacceaaddec4394677dece975
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment