22 lines
		
	
	
		
			382 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			382 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| if [ -z ${UREP+x} ]; then 
 | |
| 	UREP=https://gitea.lyc-lecastel.fr/gadmin/gsb2021.git 
 | |
| fi
 | |
| REPO=$(basename ${UREP})
 | |
| 
 | |
| dir=/root/tools/ansible
 | |
| host=depl
 | |
| hostf=$host.sio.lan
 | |
| 
 | |
| [ -e ${dir} ] || mkdir -p ${dir}
 | |
| 
 | |
| #grep $hostf /etc/hosts > /dev/null || echo "10.121.38.10 $hostf $host" >> /etc/hosts
 | |
| 
 | |
| cd  ${dir}
 | |
| 
 | |
| hostname  > hosts
 | |
| ansible-pull -i ${dir}/hosts  -U "${UREP}"
 | |
| 
 | |
| exit 0
 |