Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nextgen-router
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
nextgen-router
Commits
561d29f5
Commit
561d29f5
authored
Mar 01, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ntpdate cron
parent
8f0c125f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
11 deletions
+23
-11
files/pxe/boot.cfg.j2
files/pxe/boot.cfg.j2
+1
-9
files/services/docker-compose.yml.j2
files/services/docker-compose.yml.j2
+1
-1
install.yaml
install.yaml
+1
-1
services.yaml
services.yaml
+9
-0
tasks/set-ntp-server.yaml
tasks/set-ntp-server.yaml
+11
-0
No files found.
files/pxe/boot.cfg.j2
View file @
561d29f5
...
@@ -8,15 +8,7 @@ set site_name MyCard Boot
...
@@ -8,15 +8,7 @@ set site_name MyCard Boot
set self_address {{services.address}}
set self_address {{services.address}}
# ntp address
# ntp address
{% if dnsmasq.ntp is defined and dnsmasq.ntp %}
set ntp_address {{ntp_server}}
{% if dnsmasq.ntp == "localhost" %}
set ntp_address ${self_address}
{% else %}
set ntp_address {{dnsmasq.ntp}}
{% endif %}
{% else %}
set ntp_address ntp.aliyun.com
{% endif %}
# set boot domain
# set boot domain
set boot_domain ${self_address}:16980
set boot_domain ${self_address}:16980
...
...
files/services/docker-compose.yml.j2
View file @
561d29f5
...
@@ -84,7 +84,7 @@ services:
...
@@ -84,7 +84,7 @@ services:
restart: always
restart: always
image: cturra/ntp
image: cturra/ntp
environment:
environment:
NTP_SERVERS: {{
services
.ntp.upstream | default('ntp1.aliyun.com,ntp2.aliyun.com,ntp3.aliyun.com,ntp4.aliyun.com') }}
NTP_SERVERS: {{
dnsmasq
.ntp.upstream | default('ntp1.aliyun.com,ntp2.aliyun.com,ntp3.aliyun.com,ntp4.aliyun.com') }}
cap_add:
cap_add:
- SYS_TIME
- SYS_TIME
ports:
ports:
...
...
install.yaml
View file @
561d29f5
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
tasks
:
tasks
:
-
name
:
apt
-
name
:
apt
apt
:
apt
:
name
:
net-tools,bridge-utils,pppoe,iproute2,iptables,ipset,subnetcalc,ifupdown,ifenslave
name
:
net-tools,bridge-utils,pppoe,iproute2,iptables,ipset,subnetcalc,ifupdown,ifenslave
,ntpdate,util-linux
update_cache
:
true
update_cache
:
true
-
name
:
Ubuntu things
-
name
:
Ubuntu things
apt
:
apt
:
...
...
services.yaml
View file @
561d29f5
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
template
:
template
:
src
:
./files/services/docker-compose.yml.j2
src
:
./files/services/docker-compose.yml.j2
dest
:
'
{{ansible_user_dir}}/nextgen-router/services/others/docker-compose.yml'
dest
:
'
{{ansible_user_dir}}/nextgen-router/services/others/docker-compose.yml'
-
name
:
ntp server
import_tasks
:
./tasks/set-ntp-server.yaml
-
name
:
pxe things
-
name
:
pxe things
include_tasks
:
./tasks/pxe.yaml
include_tasks
:
./tasks/pxe.yaml
when
:
dnsmasq.pxe is defined and (dnsmasq.pxe == "localhost" or (dnsmasq.pxe.localhost is defined and dnsmasq.pxe.localhost))
when
:
dnsmasq.pxe is defined and (dnsmasq.pxe == "localhost" or (dnsmasq.pxe.localhost is defined and dnsmasq.pxe.localhost))
...
@@ -18,6 +20,13 @@
...
@@ -18,6 +20,13 @@
docker_compose
:
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-router/services/others'
project_src
:
'
{{ansible_user_dir}}/nextgen-router/services/others'
remove_orphans
:
true
remove_orphans
:
true
-
name
:
ntpdate update cron
become
:
true
blockinfile
:
path
:
/etc/crontab
marker
:
'
#
{mark}
MyCard
NextGen
Router
block
for
ntpdate'
block
:
|
40 */2 * * * root /usr/sbin/ntpdate -u {{ntp_server}} ; /usr/sbin/hwclock -w
handlers
:
handlers
:
-
name
:
restart_pxe_nginx
-
name
:
restart_pxe_nginx
docker_compose
:
docker_compose
:
...
...
tasks/set-ntp-server.yaml
0 → 100644
View file @
561d29f5
-
name
:
default ntp server
set_fact
:
ntp_server
:
ntp.aliyun.com
-
name
:
ntp server from specific
set_fact
:
ntp_server
:
'
{{dnsmasq.ntp}}'
when
:
dnsmasq.ntp is defined and not (dnsmasq.ntp == "localhost" or (dnsmasq.ntp.localhost is defined and dnsmasq.ntp.localhost))
-
name
:
ntp server from self
set_fact
:
ntp_server
:
'
{{services.address}}'
when
:
dnsmasq.ntp is defined and (dnsmasq.ntp == "localhost" or (dnsmasq.ntp.localhost is defined and dnsmasq.ntp.localhost))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment