Advertisement
gerl1ng

Saltstack_AttributeError: 'NoneType' object has no attribute

Feb 13th, 2015
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.24 KB | None | 0 0
  1. Using Vagrant Base Image hashicorp/precise64
  2.  
  3. root@minion3:~# uname -a
  4. Linux minion3 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
  5. root@minion3:~# salt-call --version
  6. salt-call 2014.7.1 (Helium)
  7.  
  8. #######################################################################################
  9.  
  10. root@minion3:~# salt-call -l debug state.highstate
  11. [DEBUG ] Reading configuration from /etc/salt/minion
  12. [DEBUG ] Using cached minion ID from /etc/salt/minion_id: minion3
  13. [DEBUG ] Configuration file path: /etc/salt/minion
  14. [DEBUG ] Reading configuration from /etc/salt/minion
  15. [DEBUG ] Decrypting the current master AES key
  16. [DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
  17. [DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
  18. [DEBUG ] Mako not available
  19. [DEBUG ] Decrypting the current master AES key
  20. [DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
  21. [DEBUG ] Reading configuration from /etc/salt/minion
  22. [DEBUG ] Decrypting the current master AES key
  23. [DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
  24. [DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
  25. [INFO ] Loading fresh modules for state activity
  26. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://top.sls'
  27. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  28. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/top.sls:
  29. base:
  30. '*':
  31. - default
  32. 'minion1':
  33. - application1.proxy
  34. 'minion[24]':
  35. - application1.webserver
  36. 'minion3':
  37. - application1.database
  38.  
  39. [DEBUG ] Results of YAML rendering:
  40. OrderedDict([('base', OrderedDict([('*', ['default']), ('minion1', ['application1.proxy']), ('minion[24]', ['application1.webserver']), ('minion3', ['application1.database'])]))])
  41. [DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
  42. [DEBUG ] Syncing all
  43. [INFO ] Creating module dir '/var/cache/salt/minion/extmods/modules'
  44. [INFO ] Syncing modules for environment 'base'
  45. [INFO ] Loading cache from salt://_modules, for base)
  46. [DEBUG ] Decrypting the current master AES key
  47. [DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
  48. [INFO ] Caching directory '_modules/' for environment 'base'
  49. [DEBUG ] Local cache dir: '/var/cache/salt/minion/files/base/_modules'
  50. [INFO ] Creating module dir '/var/cache/salt/minion/extmods/states'
  51. [INFO ] Syncing states for environment 'base'
  52. [INFO ] Loading cache from salt://_states, for base)
  53. [INFO ] Caching directory '_states/' for environment 'base'
  54. [DEBUG ] Local cache dir: '/var/cache/salt/minion/files/base/_states'
  55. [INFO ] Creating module dir '/var/cache/salt/minion/extmods/grains'
  56. [INFO ] Syncing grains for environment 'base'
  57. [INFO ] Loading cache from salt://_grains, for base)
  58. [INFO ] Caching directory '_grains/' for environment 'base'
  59. [DEBUG ] Local cache dir: '/var/cache/salt/minion/files/base/_grains'
  60. [INFO ] Creating module dir '/var/cache/salt/minion/extmods/renderers'
  61. [INFO ] Syncing renderers for environment 'base'
  62. [INFO ] Loading cache from salt://_renderers, for base)
  63. [INFO ] Caching directory '_renderers/' for environment 'base'
  64. [DEBUG ] Local cache dir: '/var/cache/salt/minion/files/base/_renderers'
  65. [INFO ] Creating module dir '/var/cache/salt/minion/extmods/returners'
  66. [INFO ] Syncing returners for environment 'base'
  67. [INFO ] Loading cache from salt://_returners, for base)
  68. [INFO ] Caching directory '_returners/' for environment 'base'
  69. [DEBUG ] Local cache dir: '/var/cache/salt/minion/files/base/_returners'
  70. [INFO ] Creating module dir '/var/cache/salt/minion/extmods/outputters'
  71. [INFO ] Syncing outputters for environment 'base'
  72. [INFO ] Loading cache from salt://_outputters, for base)
  73. [INFO ] Caching directory '_outputters/' for environment 'base'
  74. [DEBUG ] Local cache dir: '/var/cache/salt/minion/files/base/_outputters'
  75. [INFO ] Creating module dir '/var/cache/salt/minion/extmods/utils'
  76. [INFO ] Syncing utils for environment 'base'
  77. [INFO ] Loading cache from salt://_utils, for base)
  78. [INFO ] Caching directory '_utils/' for environment 'base'
  79. [DEBUG ] Local cache dir: '/var/cache/salt/minion/files/base/_utils'
  80. [DEBUG ] Refreshing modules...
  81. [INFO ] Loading fresh modules for state activity
  82. [DEBUG ] SaltEvent PUB socket URI: ipc:///var/run/salt/minion/minion_event_373d963849_pub.ipc
  83. [DEBUG ] SaltEvent PULL socket URI: ipc:///var/run/salt/minion/minion_event_373d963849_pull.ipc
  84. [DEBUG ] Sending event - data = {'_stamp': '2015-02-13T13:26:29.267657'}
  85. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://default.sls'
  86. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  87. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/default.sls:
  88. include:
  89. - packages.git
  90. - packages.htop
  91. - packages.openssh
  92. - services.openssh-server
  93. - packages.tmux
  94. [DEBUG ] Results of YAML rendering:
  95. OrderedDict([('include', ['packages.git', 'packages.htop', 'packages.openssh', 'services.openssh-server', 'packages.tmux'])])
  96. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://packages/git.sls'
  97. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  98. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/packages/git.sls:
  99. git:
  100. pkg:
  101. - latest
  102. [DEBUG ] Results of YAML rendering:
  103. OrderedDict([('git', OrderedDict([('pkg', ['latest'])]))])
  104. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://packages/htop.sls'
  105. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  106. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/packages/htop.sls:
  107. htop:
  108. pkg:
  109. - latest
  110. [DEBUG ] Results of YAML rendering:
  111. OrderedDict([('htop', OrderedDict([('pkg', ['latest'])]))])
  112. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://packages/openssh.sls'
  113. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  114. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/packages/openssh.sls:
  115. openssh:
  116. pkg:
  117.  
  118. - name: openssh-client
  119.  
  120. - latest
  121. [DEBUG ] Results of YAML rendering:
  122. OrderedDict([('openssh', OrderedDict([('pkg', [OrderedDict([('name', 'openssh-client')]), 'latest'])]))])
  123. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://services/openssh-server.sls'
  124. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  125. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/services/openssh-server.sls:
  126. include:
  127. - packages.openssh-server
  128.  
  129. extend:
  130. openssh-server:
  131. service:
  132.  
  133. - name: ssh
  134.  
  135. - running
  136. - require:
  137. - pkg: openssh-server
  138. [DEBUG ] Results of YAML rendering:
  139. OrderedDict([('include', ['packages.openssh-server']), ('extend', OrderedDict([('openssh-server', OrderedDict([('service', [OrderedDict([('name', 'ssh')]), 'running', OrderedDict([('require', [OrderedDict([('pkg', 'openssh-server')])])])])]))]))])
  140. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://packages/openssh-server.sls'
  141. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  142. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/packages/openssh-server.sls:
  143. openssh-server:
  144. pkg:
  145. - latest
  146. [DEBUG ] Results of YAML rendering:
  147. OrderedDict([('openssh-server', OrderedDict([('pkg', ['latest'])]))])
  148. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://packages/tmux.sls'
  149. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  150. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/packages/tmux.sls:
  151. tmux:
  152. pkg:
  153. - latest
  154. [DEBUG ] Results of YAML rendering:
  155. OrderedDict([('tmux', OrderedDict([('pkg', ['latest'])]))])
  156. [DEBUG ] Fetching file from saltenv 'base', ** attempting ** 'salt://application1/database.sls'
  157. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://application1/database/init.sls'
  158. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  159. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/application1/database/init.sls:
  160. include:
  161. - services.mariadb
  162.  
  163.  
  164.  
  165. extend:
  166. mariadb-server:
  167. service:
  168. - require:
  169. file: /etc/mysql/my.cnf
  170.  
  171. /etc/mysql/my.cnf:
  172. file:
  173. - managed
  174. - user: root
  175. - group: root
  176. - mode: 644
  177. - source: salt://application1/database/my.cnf_ubuntu
  178. - watch:
  179. - pkg: mariadb-server
  180.  
  181.  
  182.  
  183. mysql_python:
  184. pkg:
  185.  
  186. - name: python-mysqldb
  187.  
  188. - installed
  189.  
  190. mysql-connector-python:
  191. pkg:
  192.  
  193. - name: python-mysql.connector
  194.  
  195. - installed
  196.  
  197. wordpress_database:
  198. mysql_database.present:
  199. - name: wordpress_prod
  200.  
  201. access_localhost:
  202. mysql_user.present:
  203. - name: wordpress
  204. - password: wordpress
  205. - host: 'localhost'
  206. - require:
  207. - service: mariadb-server
  208. mysql_grants.present:
  209. - database: wordpress_prod.*
  210. - grant: ALL PRIVILEGES
  211. - user: wordpress
  212. - host: 'localhost'
  213. - require:
  214. - service: mariadb-server
  215.  
  216. access_minion2:
  217. mysql_user.present:
  218. - name: wordpress
  219. - password: wordpress
  220. - host: 'minion2'
  221. - require:
  222. - service: mariadb-server
  223. mysql_grants.present:
  224. - database: wordpress_prod.*
  225. - grant: ALL PRIVILEGES
  226. - user: wordpress
  227. - host: 'minion2'
  228. - require:
  229. - service: mariadb-server
  230.  
  231. access_minion4:
  232. mysql_user.present:
  233. - name: wordpress
  234. - password: wordpress
  235. - host: 'minion4'
  236. - require:
  237. - service: mariadb-server
  238. mysql_grants.present:
  239. - database: wordpress_prod.*
  240. - grant: ALL PRIVILEGES
  241. - user: wordpress
  242. - host: 'minion4'
  243. - require:
  244. - service: mariadb-server
  245. [DEBUG ] Results of YAML rendering:
  246. OrderedDict([('include', ['services.mariadb']), ('extend', OrderedDict([('mariadb-server', OrderedDict([('service', [OrderedDict([('require', None), ('file', '/etc/mysql/my.cnf')])])]))])), ('/etc/mysql/my.cnf', OrderedDict([('file', ['managed', OrderedDict([('user', 'root')]), OrderedDict([('group', 'root')]), OrderedDict([('mode', 644)]), OrderedDict([('source', 'salt://application1/database/my.cnf_ubuntu')]), OrderedDict([('watch', [OrderedDict([('pkg', 'mariadb-server')])])])])])), ('mysql_python', OrderedDict([('pkg', [OrderedDict([('name', 'python-mysqldb')]), 'installed'])])), ('mysql-connector-python', OrderedDict([('pkg', [OrderedDict([('name', 'python-mysql.connector')]), 'installed'])])), ('wordpress_database', OrderedDict([('mysql_database.present', [OrderedDict([('name', 'wordpress_prod')])])])), ('access_localhost', OrderedDict([('mysql_user.present', [OrderedDict([('name', 'wordpress')]), OrderedDict([('password', 'wordpress')]), OrderedDict([('host', 'localhost')]), OrderedDict([('require', [OrderedDict([('service', 'mariadb-server')])])])]), ('mysql_grants.present', [OrderedDict([('database', 'wordpress_prod.*')]), OrderedDict([('grant', 'ALL PRIVILEGES')]), OrderedDict([('user', 'wordpress')]), OrderedDict([('host', 'localhost')]), OrderedDict([('require', [OrderedDict([('service', 'mariadb-server')])])])])])), ('access_minion2', OrderedDict([('mysql_user.present', [OrderedDict([('name', 'wordpress')]), OrderedDict([('password', 'wordpress')]), OrderedDict([('host', 'minion2')]), OrderedDict([('require', [OrderedDict([('service', 'mariadb-server')])])])]), ('mysql_grants.present', [OrderedDict([('database', 'wordpress_prod.*')]), OrderedDict([('grant', 'ALL PRIVILEGES')]), OrderedDict([('user', 'wordpress')]), OrderedDict([('host', 'minion2')]), OrderedDict([('require', [OrderedDict([('service', 'mariadb-server')])])])])])), ('access_minion4', OrderedDict([('mysql_user.present', [OrderedDict([('name', 'wordpress')]), OrderedDict([('password', 'wordpress')]), OrderedDict([('host', 'minion4')]), OrderedDict([('require', [OrderedDict([('service', 'mariadb-server')])])])]), ('mysql_grants.present', [OrderedDict([('database', 'wordpress_prod.*')]), OrderedDict([('grant', 'ALL PRIVILEGES')]), OrderedDict([('user', 'wordpress')]), OrderedDict([('host', 'minion4')]), OrderedDict([('require', [OrderedDict([('service', 'mariadb-server')])])])])]))])
  247. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://services/mariadb.sls'
  248. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  249. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/services/mariadb.sls:
  250. include:
  251. - packages.mariadb
  252.  
  253. extend:
  254. mariadb-server:
  255. service:
  256.  
  257. - name: mysql
  258.  
  259. - running
  260. - require:
  261. - pkg: mariadb-server
  262.  
  263. [DEBUG ] Results of YAML rendering:
  264. OrderedDict([('include', ['packages.mariadb']), ('extend', OrderedDict([('mariadb-server', OrderedDict([('service', [OrderedDict([('name', 'mysql')]), 'running', OrderedDict([('require', [OrderedDict([('pkg', 'mariadb-server')])])])])]))]))])
  265. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://packages/mariadb.sls'
  266. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  267. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/packages/mariadb.sls:
  268. include:
  269. - packages.mariadb-client
  270.  
  271. mariadb-server:
  272. pkg:
  273.  
  274. - name: mysql-server
  275.  
  276. - latest
  277. [DEBUG ] Results of YAML rendering:
  278. OrderedDict([('include', ['packages.mariadb-client']), ('mariadb-server', OrderedDict([('pkg', [OrderedDict([('name', 'mysql-server')]), 'latest'])]))])
  279. [INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://packages/mariadb-client.sls'
  280. [DEBUG ] Jinja search path: ['/var/cache/salt/minion/files/base']
  281. [DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/packages/mariadb-client.sls:
  282. mariadb-client:
  283. pkg:
  284.  
  285. - name: mysql-client
  286.  
  287. - latest
  288.  
  289.  
  290. [DEBUG ] Results of YAML rendering:
  291. OrderedDict([('mariadb-client', OrderedDict([('pkg', [OrderedDict([('name', 'mysql-client')]), 'latest'])]))])
  292. [ERROR ] An un-handled exception was caught by salt's global exception handler:
  293. AttributeError: 'NoneType' object has no attribute 'extend'
  294. Traceback (most recent call last):
  295. File "/usr/bin/salt-call", line 11, in <module>
  296. salt_call()
  297. File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 123, in salt_call
  298. client.run()
  299. File "/usr/lib/python2.7/dist-packages/salt/cli/__init__.py", line 420, in run
  300. caller.run()
  301. File "/usr/lib/python2.7/dist-packages/salt/cli/caller.py", line 225, in run
  302. ret = self.call()
  303. File "/usr/lib/python2.7/dist-packages/salt/cli/caller.py", line 129, in call
  304. ret['return'] = func(*args, **kwargs)
  305. File "/usr/lib/python2.7/dist-packages/salt/modules/state.py", line 325, in highstate
  306. whitelist=kwargs.get('whitelist')
  307. File "/usr/lib/python2.7/dist-packages/salt/state.py", line 2883, in call_highstate
  308. return self.state.call_high(high)
  309. File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1983, in call_high
  310. high, ext_errors = self.reconcile_extend(high)
  311. File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1175, in reconcile_extend
  312. (high[name][state][hind][argfirst]
  313. AttributeError: 'NoneType' object has no attribute 'extend'
  314. Traceback (most recent call last):
  315. File "/usr/bin/salt-call", line 11, in <module>
  316. salt_call()
  317. File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 123, in salt_call
  318. client.run()
  319. File "/usr/lib/python2.7/dist-packages/salt/cli/__init__.py", line 420, in run
  320. caller.run()
  321. File "/usr/lib/python2.7/dist-packages/salt/cli/caller.py", line 225, in run
  322. ret = self.call()
  323. File "/usr/lib/python2.7/dist-packages/salt/cli/caller.py", line 129, in call
  324. ret['return'] = func(*args, **kwargs)
  325. File "/usr/lib/python2.7/dist-packages/salt/modules/state.py", line 325, in highstate
  326. whitelist=kwargs.get('whitelist')
  327. File "/usr/lib/python2.7/dist-packages/salt/state.py", line 2883, in call_highstate
  328. return self.state.call_high(high)
  329. File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1983, in call_high
  330. high, ext_errors = self.reconcile_extend(high)
  331. File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1175, in reconcile_extend
  332. (high[name][state][hind][argfirst]
  333. AttributeError: 'NoneType' object has no attribute 'extend'
  334.  
  335.  
  336. #######################################################################################
  337. The Files:
  338. ##
  339. application1/database/top.sls
  340.  
  341. include:
  342. - services.mariadb
  343.  
  344. {% if grains['os'] == 'Ubuntu' %}
  345. extend:
  346. mariadb-server:
  347. service:
  348. - require:
  349. file: /etc/mysql/my.cnf
  350.  
  351. /etc/mysql/my.cnf:
  352. file:
  353. - managed
  354. - user: root
  355. - group: root
  356. - mode: 644
  357. - source: salt://application1/database/my.cnf_ubuntu
  358. - watch:
  359. - pkg: mariadb-server
  360. {% endif %}
  361.  
  362. mysql_python:
  363. pkg:
  364. {% if grains['os'] == 'Ubuntu' %}
  365. - name: python-mysqldb
  366. {% else %}
  367. - name: MySQL-python
  368. {% endif %}
  369. - installed
  370.  
  371. mysql-connector-python:
  372. pkg:
  373. {% if grains['os'] == 'Ubuntu' %}
  374. - name: python-mysql.connector
  375. {% else %}
  376. - name: mysql-connector-python
  377. {% endif %}
  378. - installed
  379.  
  380. wordpress_database:
  381. mysql_database.present:
  382. - name: wordpress_prod
  383.  
  384. access_localhost:
  385. mysql_user.present:
  386. - name: wordpress
  387. - password: wordpress
  388. - host: 'localhost'
  389. - require:
  390. - service: mariadb-server
  391. mysql_grants.present:
  392. - database: wordpress_prod.*
  393. - grant: ALL PRIVILEGES
  394. - user: wordpress
  395. - host: 'localhost'
  396. - require:
  397. - service: mariadb-server
  398.  
  399. access_minion2:
  400. mysql_user.present:
  401. - name: wordpress
  402. - password: wordpress
  403. - host: 'minion2'
  404. - require:
  405. - service: mariadb-server
  406. mysql_grants.present:
  407. - database: wordpress_prod.*
  408. - grant: ALL PRIVILEGES
  409. - user: wordpress
  410. - host: 'minion2'
  411. - require:
  412. - service: mariadb-server
  413.  
  414. access_minion4:
  415. mysql_user.present:
  416. - name: wordpress
  417. - password: wordpress
  418. - host: 'minion4'
  419. - require:
  420. - service: mariadb-server
  421. mysql_grants.present:
  422. - database: wordpress_prod.*
  423. - grant: ALL PRIVILEGES
  424. - user: wordpress
  425. - host: 'minion4'
  426. - require:
  427. - service: mariadb-server
  428.  
  429.  
  430. ##
  431. services/mariadb.sls
  432.  
  433. include:
  434. - packages.mariadb
  435.  
  436. extend:
  437. mariadb-server:
  438. service:
  439. {% if grains['os'] == 'Ubuntu' %}
  440. - name: mysql
  441. {% else %}
  442. - name: mariadb
  443. {% endif %}
  444. - running
  445. - require:
  446. - pkg: mariadb-server
  447.  
  448. ##
  449. packages/mariadb.sls
  450.  
  451. include:
  452. - packages.mariadb-client
  453.  
  454. mariadb-server:
  455. pkg:
  456. {% if grains['os'] == 'Ubuntu' %}
  457. - name: mysql-server
  458. {% endif %}
  459. - latest
  460.  
  461. ##
  462. packages/mariadb-client.sls
  463.  
  464. mariadb-client:
  465. pkg:
  466. {% if grains['os'] == 'Ubuntu' %}
  467. - name: mysql-client
  468. {% else %}
  469. - name: mariadb
  470. {% endif %}
  471. - latest
  472.  
  473. ##
  474. top.sls
  475.  
  476. base:
  477. '*':
  478. - default
  479. 'minion1':
  480. - application1.proxy
  481. 'minion[24]':
  482. - application1.webserver
  483. 'minion3':
  484. - application1.database
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement