Skip to content
Snippets Groups Projects
Commit 859f6f3a authored by Cécile Cavet's avatar Cécile Cavet
Browse files

centos7

parent d3c8386f
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,5 @@
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
{% for host in groups['all'] %}
{{ hostvars[host]['ansible_default_ipv4'].address }} {{ hostvars[host]['ansible_hostname'] }
}
{{ hostvars[host]['ansible_default_ipv4'].address }} {{ hostvars[host]['ansible_hostname'] }}
{% endfor %}
\ No newline at end of file
---
- include_vars: "{{ansible_os_family}}.yml"
# User creation, server actions
......@@ -32,14 +33,15 @@
action: template src=epel.repo dest=/etc/yum.repos.d/epel.repo
when: "ansible_os_family == 'RedHat' and epel_repo.stat.exists == false"
- include: "{{torque_type_of_node}}.yml"
- name: switch server or mom
include: "{{ torque_type_of_node }}.yml"
- name: Open ports in the firewall
command: iptables -I INPUT -p {{item}} --dport 15001:15004 -j ACCEPT
ignore_errors: yes
with_items:
- tcp
- udp
command: iptables -I INPUT -p {{item}} --dport 15001:15004 -j ACCEPT
ignore_errors: yes
with_items:
- tcp
- udp
- name: save iptables
shell: iptables-save > /etc/sysconfig/iptables
......@@ -52,10 +54,3 @@
- mount: name=/home src={{ hostvars[groups['front'][0]]['ansible_eth0']['ipv4']['address'] }}:/home fstype=nfs state=mounted
when: "torque_type_of_node == 'mom' and not hostvars[groups['front'][0]]['IM_NODE_NET_0_IP'] is defined and hostvars[groups['front'][0]]['ansible_eth0']['ipv4']['address'] != ansible_eth0.ipv4.address"
# - wait_for: port=2049 delay=10 host={{ hostvars[groups['front'][0]]['IM_NODE_NET_0_IP'] }} timeout=300
# when: "torque_type_of_node == 'mom' and hostvars[groups['front'][0]]['IM_NODE_NET_0_IP'] is defined and hostvars[groups['front'][0]]['IM_NODE_NET_0_IP'] != IM_NODE_NET_0_IP"
# ignore_errors: yes
# - mount: name=/home src={{ hostvars[groups['front'][0]]['IM_NODE_NET_0_IP'] }}:/home fstype=nfs state=mounted
# when: "torque_type_of_node == 'mom' and hostvars[groups['front'][0]]['IM_NODE_NET_0_IP'] is defined and hostvars[groups['front'][0]]['IM_NODE_NET_0_IP'] != IM_NODE_NET_0_IP"
---
# RedHat related OSs
- name: Yum install torque-mom
action: yum pkg=torque-mom,nfs-utils state=installed
......
---
# RedHat related OSs
- name: Yum install {{ item }}
action: yum pkg={{ item }} state=installed
......@@ -35,13 +36,12 @@
command: exportfs -ra
- name: Open ports in the firewall for NFS
command: iptables -I INPUT -p {{ item[1] }} --dport {{ item[0] }}:{{ item[0] }} -j ACCEPT
ignore_errors: yes
with_nested:
- [ '111', '2049' ]
- [ 'tcp', 'udp' ]
command: iptables -I INPUT -p {{ item[1] }} --dport {{ item[0] }}:{{ item[0] }} -j ACCEPT
ignore_errors: yes
with_nested:
- [ '111', '2049' ]
- [ 'tcp', 'udp' ]
- name: Restart NFS server
service: name=nfs state=restarted
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment